How to override font generation by Needle?

Due to this issue https://github.com/needle-tools/needle-engine-support/issues/95, I followed instructions here but when using my own generated font png + json which looked correct in the generator preview, the exporter seems to still be using its own exported version of the font from its use in the Editor. How do I overwrite this behaviour? https://github.com/needle-tools/needle-engine-support/blob/015409d2ad159c388f26cb4ff705cc0b87b83150/documentation/component-reference.md#:~:text=Render%20Text%20using%20Unity's%20UI.%20Currently%20font%20export%20does%20not%20work%20automatically.%20For%20custom%20fonts%20generate%20a%20msdf.json%20and%20.png%20file%20using%20this%20generator%20and%20add%20them%20with%20your%20font%20name%20and%20style%20to%20the%20include/fonts%20folder%20of%20your%20web%20project%20(e.g.%20arial-bold.png%20and%20arial-bold-msdf.json).

Original Post on Discord

by user 103054507105067008

Sorry the docs are not up to date here. The font assets are now in the assets folder and you can replace them there

Note that you need to add them to source control too (modify the gitignore in your project) because assets is ignored by default.

Which commands were missing for your font to look correct? It’s a known issue that kerning doesnt look right yet

Happy to fix that in the generator

Just didnt have time yet to look into it further

If I overwrite them in assets, they won’t be overwritten

by user 103054507105067008

What do you mean?

If I replace assets/saira_condensed-semibold.png with my own and the json file, will the fonts be regenerated from their versions in the editor and overwrite? I overwrote them and it still looks the same

by user 103054507105067008

They will only be re-generated if you charset changes in Unity or the files dont exist.

by user 103054507105067008

These are the generator previews, and on the right also using the generated .png and json

by user 103054507105067008

Saira_Condensed-SemiBold-msdf.zip

by user 103054507105067008

I need to know why the spacing of the letters is so off, in the Unity editor, the font looks the same as the preview from the MSDF generator

by user 103054507105067008

As Marcel mentioned

It’s a known issue that kerning doesnt look right yet
Haven’t seen such an off case though, we’ll look into it

Thanks, is there any way to manually edit the character spacing/kerning to work around this for now? I was trying to remove all those horrible sprite sheet textures I was using that we discussed and move onto using UI text with strings instead

by user 103054507105067008

Other fonts like the Batman Forever font looked fine when exported aside from some size differences which were probably also related to Kerning, wish this app was for Batman haha

by user 103054507105067008

Related issue I believe

Nice, luckily they mention the horizontal as well as the vertical, seems the glyph adjuster linked only worked to adjust y axis which is a shame

by user 103054507105067008

Yeah I also don’t think it’s a good idea to simply adjust the baseline by magic

I’ll chase it up on that issue :sob: was excited to rip out those chunky sprite sheets we were using in the website today

by user 103054507105067008