No Kerning Pairs on TMP font import

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.

Thanks for the quick response.

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.

Ok i’ll take a look at some tools, thanks for the help.

Hi all,

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…

Can you provide me with a link to this font file. It is kind of strange that it would create all those empty entries.

I’m encountering the same issue after creating a font asset using the LiberationSans font included in the TMP Essential Resources.

I’m on Unity 2019.2.12 using TextMeshPro 2.10 preview.

See screenshot for setup.

As a result I’m getting 3000+ pages of Adjustment Pair that are empty!

Is there anyway to remove these on bulk and not one by one? Or prevent Font Asset Creator from generating empty pairs?

5194223--516305--Screenshot 2019-11-20 at 11.07.28.png

I am aware of this issue which I have already fixed. Fix will be included in preview 3.

Here is the change that will address this issue. This is in the TMPro_FontAssetCreatorWindow.cs file.

These changes should be made in the global package cache otherwise they will reset when reopening Unity.

2 Likes

Hello. It still doesn’t work with AcuminPro fonts (for example). Look at them, please. Even in preview 3.

Does TMP still not fully support importing kerning data?

The Glyph Adjustment Table is empty when I create a Font Asset with TMP’s Font Asset Creator using Rubik Medium from Google Fonts as the Source Font.

This is making TMP impossible for us to use in production.

(Using TMP 2.0.1 in Unity 2019.4.4f1)

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.

  1. 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.

6509701--733567--upload_2020-11-10_12-13-29.png

Just did a quick test using “Wave Text” and here are the Glyph Adjustment Pairs for the following characters / glyphs for Rubik Medium.

6509701--733570--upload_2020-11-10_12-16-16.png

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.

Thanks for the reply. I’ve upgraded to 2.1.3 and followed your instructions but I’m still getting an empty Glyph Adjustments Table.

Here’s a video of me following the steps given. Could you please tell me what I’m doing wrong here?

There appears to be two versions of the Rubik font file as seen below.

6510397--733654--upload_2020-11-10_15-3-38.png
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.

Hello,

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.

Here is a preview of those new tables.

7171927--859477--upload_2021-5-24_13-56-8.png

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.

This is really good news! I look forward to these!

How often are TMP releases? Do they typically align with Unity major releases? Thanks!

They do not align with Unity releases.

The new set of preview releases are getting finalized where the first preview should be out within the next 10 - 14 days.

Cool! How do I access preview releases of TMP?