Skip to content

Commit

Permalink
Added text justify features to the textparser
Browse files Browse the repository at this point in the history
  • Loading branch information
ZILtoid1991 committed Mar 19, 2024
1 parent 14f2170 commit d7299f0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pixelperfectengine/src/pixelperfectengine/system/lang/textparser.d
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,24 @@ public class TextParserTempl(BitmapType = Bitmap8Bit)
newFrmt.rowHeight = rowHeightStr.to!short;
} catch (Exception e) {

}
switch (attributes.get("justify", null)) {
case "left":
newFrmt.formatFlags &= ~FormattingFlags.justifyMask;
break;
case "right":
newFrmt.formatFlags &= ~FormattingFlags.justifyMask;
newFrmt.formatFlags |= FormattingFlags.rightJustify;
break;
case "center":
newFrmt.formatFlags &= ~FormattingFlags.justifyMask;
newFrmt.formatFlags |= FormattingFlags.centerJustify;
break;
case "fill":
newFrmt.formatFlags &= ~FormattingFlags.justifyMask;
newFrmt.formatFlags |= FormattingFlags.fillEntireLine;
break;
default: break;
}
testFormatting(newFrmt);
currTextBlock.formatting = currFrmt;
Expand Down

0 comments on commit d7299f0

Please sign in to comment.