I am trying to obtain proper national (polish) characters in root. No luck so far, but I guess this may be because ROOT by default uses iso8859-2 fonts. However, I cannot find a way to change the font of, for example, TGraph title. Setting
does not make it courier, so the option apparently does not affect the title. Could you please tell me, how to change fonts of paves/axes etc., to support national characters?
I’ve read the original post regarding this macro. The problem is, that these characters are available in iso8859-1 encoding. So they write them down, convert to iso8859-1 and have them. Mine characters are not in this encoding - they are in, for example, iso8859-2. Therefore after properly typing in my macro national character in iso8859-2, I get, for example, plusminus sign. So I need to change font somehow.
I attach a sample macro. What I should get is “aą” in the graph title, the second character being “a” with a tail. What I get is “a\pm”. The macro is in iso8859-2 encoding. It cannot be converted to iso8859-1. test1.C (91 Bytes)
The problem for Latin-based Slavic languages is that some accents are missing.
In your case, the “stroke” and the “ogonek” are missing for the Polish language.
Try:
{
new TCanvas();
(new TLatex(0.1, 0.9, "dot above ... #dot{z} #dot{Z}"))->Draw();
(new TLatex(0.1, 0.8, "acute ... #acute{z} #acute{Z} #acute{s} #acute{S} #acute{o} #acute{O} #acute{n} #acute{N} #acute{c} #acute{C}"))->Draw();
(new TLatex(0.1, 0.7, "stroke ... #stroke{l} #stroke{L}"))->Draw();
(new TLatex(0.1, 0.6, "slash instead of stroke ... #slash{l} #slash{L}"))->Draw();
(new TLatex(0.1, 0.5, "ogonek ... #ogonek{e} #ogonek{E} #ogonek{a} #ogonek{A}"))->Draw();
}
acute is bad… I mean the upper coma is not high enough etc. Everyone seeing that knows what it should be, but it looks like 20 or more years ago, when many tricks had to be used to get “national looking” characters. Definitely does not look professional
Couet: This is normal behaviour when viewing test in encoding different than the viewing program’s. On other platforms you just change the encoding of the programm if possible. On linux, I am not sure what exactly should be done, but since fonts have encoding in their name, I expect that changing font to the one with iso8859-2 in its name should help…
However, no way to change the TPave etc. font in root
I believe the goal should be to introduce UTF-8 to ROOT.
(BTW. It seems to me that the Polish language needs “acute” on some characters which are NOT available in the “US international keyboard layout” - that’s why you cannot simply use “nice-looking” characters that are shown in the first image in this thread.)
On Linux, one can simply input any accented character using the standard US keyboard. One just needs to set X11 to use USA “International (AltGr dead keys)” keyboard.
Well, anyway, I need all polish characters, not just part of them…
The truth is that like most ROOT users I produce english language plots 99% of my time. But sometimes I have to produce something national and… what then? I need to use a completely different tool and that’s really bad.
I haven’t looked into sources, but printing on screen a character that is available in the operating system and nearly all apps have access to it, should not be that hard…
Keep in mind that it’s not all about Latin-based alphabets only.
I believe UTF-8 support in ROOT should solve all problems.
(BTW. For the Polish language, it’s not only “z” that is missing “acute”. Also “c”, “n” and “s” are missing it.)
You might try to edit the “${ROOTSYS}/etc/system.rootrc” file (and/or you can simply create your own “.rootrc” file). There are entries which explicitly define used fonts (with encoding).
Try to replace “…-iso8859-1” with “…-iso8859-2” in all entries with names “Gui.*Font”.
Yes, I know that there are many languages which are not supported by root, but are supported by the operating system. I guess support for utf8 is important. For example, students from many countries have to do some plots with national characters often and they may be forced to choose another package instead of ROOT, which would not simply fulfill this very basic requirement.