Home Download Buy Blog Forum Support

Is there any way to set fallback font for Unicode character?

Is there any way to set fallback font for Unicode character?

Postby eimg on Thu Feb 23, 2012 3:33 am

I've noticed the latest build of Sublime Text 2 (2181) can render Unicode characters (which previously cannot) using a fallback font (on Linux). But it is using a wrong font.

Is there any way yet to force-set default fallback font for specific character range?

For example, I use ".fonts.conf" to set default fallback font for Myanmar Unicode characters on Ubuntu like this:

Code: Select all
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!--- Use Myanmar3 font as default fallback font -->
<match targe="pattern">
  <test compare="eq" name="lang" qual="any">
   <string>my</string>
  </test>
  <edit mode="assign" name="family">
   <string>myanmar3</string>
  </edit>
</match>
<dir>~/.fonts</dir>
</fontconfig>


Sublime Text 2 make my coding even more comfy and it's the best editor I ever used. It improved build by build and I'm waiting this Unicode fallback rendering since long time ago.

Thanks
eimg
 
Posts: 2
Joined: Thu Feb 23, 2012 3:17 am

Re: Is there any way to set fallback font for Unicode character?

Postby jps on Thu Feb 23, 2012 3:42 am

The short answer is I don't know - Sublime Text asks Pango to render the glyphs, so I would expect the result to be the same as any other GTK application. Presumably the font fallback can be configured via fontconfig or similar, but I'm not familiar with the details.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Is there any way to set fallback font for Unicode character?

Postby eimg on Thu Feb 23, 2012 4:08 am

Sorry, I've mistaken. It using the correct font which setting in .fonts.config. But just cannot render correctly.

So, it's probably pango itself cannot or fail to render script with complex shaping. Here is the screenshot:

Image

Shaping on "tab title" is a correct one.

Thanks anyway.
eimg
 
Posts: 2
Joined: Thu Feb 23, 2012 3:17 am

Re: Is there any way to set fallback font for Unicode character?

Postby jps on Thu Feb 23, 2012 7:36 am

Sublime Text isn't able to render complex unicode sequences, unfortunately.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Is there any way to set fallback font for Unicode character?

Postby joeybaker on Tue Mar 20, 2012 8:49 pm

Are there any plans to support this? [could there be? :) ]

I just ran into a bug that was caused by some additional characters on a form field that I couldn't see in ST, and therefore didn't know was a problem until I switched to a different editor.
joeybaker
 
Posts: 1
Joined: Thu Aug 25, 2011 10:23 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 14 guests