Hi all, i’m having some issues with importing the kerning pairs for any font file with text mesh pro.
I’ve tried multiple fonts now, with the ‘import kerning pairs’ option checked, but the Kerning table info section is always empty. I can open them in other software (such as FontForge) and see the Kerning data is there, but I’ve just not been able to get anything to show up inside TMP.
I’m on a windows machine, Unity 2017.4.2, running TMP 1.0.55.2017.1.0b12.
Anyone have any suggestions? Does this work in the most recent version of text mesh pro?
Importing Kerning data is only available for font files that contain kerning data in the Kern Table as opposed to Glyph Adjustment Pair data (ie. Kerning) contained in the GPOS table which is always the case for .otf fonts and many .ttf fonts now.
Support for importing Glyph Adjustment Pairs is part of the larger support for OpenType Font Features which is on the TMP roadmap. I would like to have support for importing Glyph Adjustment Pairs available for Unity 2019.2 and if possibly 2019.1.
That makes sense, all the fonts I’ve tried are newer google or adobe fonts that likely only use the GPOS table.
Any workarounds that you know of? I haven’t been able to find any information about a conversation from GPOS to kern tables. Maybe there’s a way to at least copy/paste the TMP kerning info from one font to another?
I know some font tools allow you to export the data from any of the OpenType tables. The format of these might be different from tool to tool so you would have to most likely put that in some text file or json and then create your own script to add these to whichever font asset.
BTW: The kerning data would be in font units which is either 2048 or 1024 … so you would have to scale those values to match the sampling point size of the font asset.
P.S. The GPOS table contains all glyph positioning related data where Glyph Pair Adjustment is one sub set of all the features in the GPOS table.
I’m still getting empty Glyph Adjustment Table after importing a TTF font into Unity 2019.2.
Are there any known workarounds or chances to provide support for new fonts soon?
On the screenshot there is a table of 1712 kerning pairs imported, but each has no values…
Currently, only importing data from the Kern table is supported. Support for importing data from the GPOS table such as Pair Adjustment (advanced kerning) is on the way and will be available in a future release of 2019.4.
UPDATE
I just checked the Rubik font and it does have support for the Kern Table and as such kerning data should be extract automatically.
Depending on how you are creating your font assets, make sure that you have Get Kerning Pairs enabled in the Font Asset Creator or Get Font Features at Runtime enabled in the TMP Settings so that Dynamic Font Asset can extract this data as needed.
Just did a quick test using “Wave Text” and here are the Glyph Adjustment Pairs for the following characters / glyphs for Rubik Medium.
P.S. Latest release for 2019.4 is version 2.1.3. Please be sure to read the release notes as there have been many changes and features added.
There appears to be two versions of the Rubik font file as seen below.
The font files contained in the static folder do not include the Kern data whereas the others do. Try with the non static versions of this font.
Note: As per my first reply, support for reading Glyph Pair Adjustment records from the GPOS table will be available in a future version of Unity 2019.4 and newer.
Is there a way to export the Glyph Pair Adjustment records from a given TMP font asset to another? If I created custom Glyph pair adjustment records for a particular TMP font asset, can I reuse this same data in a another one? Any easy import/export functionality?
Currently, relying on Glyph pair adjustments in the only way to get Arabic fonts displaying properly with all diacritical marks and ligatures, and having this import/export functionality would be make it easier to setup multiple Arabic fonts without starting the process from scratch. Thanks!
No. However, I believe the Glyph Adjustment Table and related data is public so you should be able to implement some type of editor tool to do this.
Having said that and given Glyph Adjustment data would be specific to a particular font and font asset why copy this data? Are you looking to copy it to a different font asset that uses a different font as source?
Note: In the next set of preview releases of the TMP package, I will be adding support for Diacritical Marks and shortly thereafter Ligatures. At first these tables will need to be manually populated until a new version of the Editor is release that where this data will be automatically extract from the source font file.
Thanks for your reply, Stephan. Yes, I’d like to copy it to a different Arabic font asset that uses a different font source. Different Arabic fonts appear differently in the TMP and require different glyph pair adjustments to make them appear correctly in Unity. For example, the Arabic diacritic Fatha (short ‘a’ sound) doesn’t always appear above the Arabic letter when displayed in Unity (it often overlaps with the letter it is supposed to be above), and different fonts have different letter heights, so the amount of yPlacement needed for the diacritic Fatha would vary for each font and each letter combination involving Fatha as the second character. Single glyph kerning/adjustment for Fatha isn’t sufficient here and the same goes for all other diacritical marks.
Copying the Glyph pair adjustment table record data from one font asset to another would allow one to make the necessary tweaks to the records to make the other Arabic fonts appear correctly. The copied Glyph pair adjustment table would act as a master data table (or template) that includes the glyph pair combinations that require custom kerning/adjustment. Creating these records from scratch each time is a very time consuming. Thank you.