Issue with implementing zero-width no-break space/word joiner with font

Hi, we’re trying to introduce either a zero-width no break space (U+FEFF) or word joiner (U+2060) into our CJK localizations, but I realized that it does not render as a font correctly. It renders an “unknown character” instead, and I have confirmed through Google Fonts that the pasted ZWNBS/WJ works on the prevew.

Below are screenshots of my tests:

  • 這是一個用來測試詞⁠語換行的中文句子 這是一個用來測試詞語換行的中文句子
  • [Image Removed]
  • すばしっこ⁠い茶色の狐はのろまな犬を飛び越えた すばしっこい茶色の狐はのろまな犬を飛び越えた
  • [Image Removed]

Methods I’ve tried:

  • Introducing cultures to every font, then having Roboto as a fallback
  • Adding a new override on the composite font, limiting to both characters then to Roboto
  • Tested on Roboto as well

Any help is very much appreciated!

[Attachment Removed]

Hi,

If you’re able to make engine changes, this should be a pretty simple fix; we’ve got a function RenderCodepointAsWhitespace in SlateTextShaper with some hard-coded codepoints that we ignore. Adding these two to that list should be all you need to make sure we aren’t trying to resolve them to an actual glyph (and displaying the LastResort font when that fails). Alternatively, if you needed to fix this without an engine change you could add a new font which has a blank glyph for those codepoints and set up your font asset to direct those characters to your new font, but that might be a bit of a hack.

Best,

Cody

[Attachment Removed]

Hi Cody, thanks for the lead. I’ve done as you mentioned and also inserted an exception inFSlateTextShaper::InsertSubstituteGlyphs. This works, but that means my team will see block glyphs because they use the EGS Binary Engine. Is there anyway to use inheritance to bypass this issue?

[Attachment Removed]

Hi,

There isn’t currently a way to inject new codepoints to ignore without engine changes, but it should be pretty straightforward to add those codepoints to either your existing font or a new fallback font using FontForge or something similar. That would handle it at the content level, so that may be your best option for launcher build users.

[Attachment Removed]

Ah okay gotcha. Unfortunately for our situation the ship has sailed for using other fonts due to legal and licensing, but maybe we can get an exception.

Thank you very much for all the help!

[Attachment Removed]