-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional glyphs #2946
base: dev
Are you sure you want to change the base?
Additional glyphs #2946
Conversation
truthfully, while I want this feature of adding glyphs to bitmap text, I don't know if I want this specific glyph parsing method to be the defacto way of using it. I can't explore right now, but I suspect there are more generic ways to implement this, I'm afraid that adding {foo} parsing may mess or conflict with other text parsing systems, I also think there might be more generic ways to add glyph frames to existing fonts, and in general I want to add ways to split up fonts into multiple atlases for various reasons. once that is done, I think an adhoc system like this will be easy to implement, and will make a good external tool |
var tmpBmp:BitmapData = new BitmapData(Math.ceil(Math.max(parent.width, Frames.parent.width)), parent.height + Frames.parent.height, true, 0x00000000); | ||
tmpBmp.copyPixels(parent.bitmap, parent.bitmap.rect, point); | ||
tmpBmp.copyPixels(Frames.parent.bitmap, Frames.parent.bitmap.rect, new Point(0, parent.height)); | ||
|
||
parent = FlxGraphic.fromBitmapData(tmpBmp, parent.key + "+" + Frames.parent.key, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a big part of it, with multiatlases we can simply take frames from one atlas and add them to another without needing to create a new bitmap containing every frame
Also line 666 breals flash CI, by skipping the unique
arg
public var lookupTable:Map<String, String> = []; | ||
public var revLookupTable:Map<String, String> = []; | ||
|
||
/** | ||
* Special characters start index. | ||
*/ | ||
public var specialStart:Int = 500; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think this can be implemented without needing a special start, secondly, an ability to parse tokens in text strings to denote special characters seems helpful on it's own wether that maps to some large unicode index, or not
Adding
appendGlyphs
function toFlxBitmapFont
.See https://github.com/AxolStudio/HFAdditionalGlyphsDemo for an example and details.