new tagging system (see #5) WIP

- diacritics stacking does not work
- centre align with align-to-this-x-pos is untested
This commit is contained in:
minjaesong
2018-08-08 02:22:40 +09:00
parent ecac1dc8af
commit dcd6390dbf
7 changed files with 510 additions and 182 deletions

View File

@@ -0,0 +1,28 @@
package net.torvald.terrarumsansbitmap
/**
* Created by minjaesong on 2018-08-07.
*/
data class GlyphProps(
val width: Int,
val writeOnTop: Boolean,
val alignWhere: Int,
val alignXPos: Int,
val rtl: Boolean = false,
val diacriticsStackDown: Boolean = false
) {
companion object {
const val LEFT = 0
const val RIGHT = 1
const val CENTRE = 2
}
constructor(width: Int, tags: Int) : this(
width,
tags.ushr(7).and(1) == 1,
tags.ushr(5).and(3),
tags.ushr(1).and(15),
tags.and(1) == 1,
tags.ushr(8).and(1) == 1
)
}