Is it possible to adjust the Glyph Table from the script after generating the SDF?
When we re-generate the SDF, the Glyph Table parameters that we have adjusted will be reset.
Every time I generate an SDF, I have to re-set the Glyph Table values from Inspector, which is very difficult.
The ability to preserve “edits” to the various font asset tables has been requested in the past. This makes a lot of sense to me so definitely something to add at some point.
In terms of making those adjustments in code, the TMP_FontAsset.glyphTable property is public where as such, you should be able to modify individual glyphs to reapply your custom changes. Be mindful these values are relative to the sampling point size.
I was able to change the glyphTable parameter with the following code.
char chr = 'A';
uint unicodeNumber = System.Convert.ToUInt32( chr );
var character = tmpFontAsset.characterTable.Find( x => x.unicode == unicodeNumber );
if( character != null )
{
var glyph = tmpFontAsset.glyphTable.Find( x => x.index == character.glyphIndex );
if( glyph != null )
{
glyph.scale = 10.0f;
}
}