Unicode font support in treeview


#1

I am able to write Hindi in the text editor using a unicode font but whatever font I try I’m unable to render them in the treeview. All I see are boxes. Where could I set the font for the treeview ?


#2

You should be able to set a font-family for the body in your stylesheet, and that should in most UI themes cover all UI that isn’t the editing area.


#3

Great .

I added font-family rule directly to the tree-view class in styles.less accessed via Settings ( Preferences ) -> Themes -> Choose a Theme -> 'You can also style Atom by editing your stylesheet' option . Restarted Atom and now I can render using unicode fonts in treeview as well.

Thanks :smiley:


Bangla language texts not showing in editor
#4

Looking at the rest of your tree view, you might want to only use that specific font when the text is actually hindi. This is actually possible in CSS!

You can define a new font with @font-face, set the font-family to something (anything, really, I’ll assume hindi) and then set unicode-range to the hindi unicode range. Then you can use font-family: hindi and only hindi characters will render in that font (no ugly serifs in the tree view :smiley:)

@font-face {
  font-family: 'hindi'
  src: local('Hindi'); // the actual font's name on your machine
  unicode-range: U+0900-097F; // hindi unicode range: http://unicode.org/charts/PDF/U0900.pdf
}

.tree-view { font-family: 'hindi'; }

I haven’t tested this, but it should work

EDIT or just set the font-family on the body to have the characters everywhere in atom:

body { font-family: 'hindi'; }

#5

This looks plausible.

But I used Karma Bold Unicode font that took care of all inconsistencies with Latin and Devanagari characters.