Skip to content
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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

SeiferTim
Copy link
Member

Adding appendGlyphs function to FlxBitmapFont.

See https://github.com/AxolStudio/HFAdditionalGlyphsDemo for an example and details.

@Geokureli
Copy link
Member

Geokureli commented Oct 19, 2023

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

Comment on lines +662 to +666
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);
Copy link
Member

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

Comment on lines +85 to +91
public var lookupTable:Map<String, String> = [];
public var revLookupTable:Map<String, String> = [];

/**
* Special characters start index.
*/
public var specialStart:Int = 500;
Copy link
Member

@Geokureli Geokureli Oct 19, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants