soimy / msdf-bmfont-xml

Generate BMFont texture and spec XML using msdfgen

Home Page:https://soimy.github.io/msdf-bmfont-xml/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add information about font distance field settings to XML file

PrimaryFeather opened this issue · comments

I know that you recently added the type field to the XML file — thanks again for that!

However, now that I started implementation on this feature in Starling, I realised that I actually need more information — especially the "distance range".

So we could either add another property to the info element, like this:

<font>
    <info face="Arial" type="msdf" dfrange="4" .../>
    <!-- ... -->
</font>

or add another (optional) XML element altogether, e.g. like this:

<font>
    <info face="Arial" .../>
    <common lineHeight="46" .../>
    <distanceField distanceRange="4" fieldType="msdf" />
    <!-- ... -->
</font>

Perhaps the second approach would be cleaner, since it groups all distance field information together. You could also add more of your tool's settings, if it makes sense. What do you say to this?

With that information, I could not only switch to the DistanceFieldStyle automatically on text fields (if appropriate), but also apply the correct value for smoothing.

OK, I will add the distanceField node. I think it's cleaner and leave the current bmfont format as-is. Will be done today.

Awesome, thanks a lot!! 😄

Added distanceField node in font file in version 2.3.0 983d887
Test needed.

Thanks again, that was a huge help! The latest Starling version now uses this information to make sure that a distance field bitmap font is automatically using the DistanceFieldStyle with optimal settings, without the developer having to set up anything manually. Cheers!