Dear FontConfig developers, maintainers, FontConfig is used by Ubuntu and I have a problem/question about Ubuntu and/or FontConfig. I asked Ubuntu developer/maintainer and they asked me to ask FontConfig. When Ubuntu is being installed and used, there is a need to use different fonts for different language/scrip/writing systems. When I use it in Uyghur (Uighur), the system picks up another bad font for all GUI. That bad font even does not support the necessary/required code points/glyphs, and thus the GUI is full of bugs and it is hard to read/comprehend. I contacted Ubuntu developers/maintainers about this issue and was told that there is something called fontconfig snippet which they do not know well enough. So I am here to ask your help. I have couple of questions: (1) Why does the fontconfig select the font poorly here, even selecting a font which does not support the required code points and or glyphs? (2) Is the any way to tell/force fontconfig to use a font for the given language environment / writing system / scripts? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120312/38ee1ce3/attachment.htm>
Please be aware that no one can tell you the better answer without the details. this is a rough answer for the rough question. if you aren''t comfortable with it, please give us what you did, what happened and what you were expected. otherwise there are no way to see what''s wrong in fontconfig. On Tue, Mar 13, 2012 at 9:30 AM, Eagle Burkut <eagle.burkut at gmail.com> wrote:> So I am here to ask your help. I have couple of questions: > > (1) Why does the fontconfig select the font poorly here, even selecting a > font which does not support the required code points and or glyphs?The possible reason is, 1) there are no better fonts against the query. which covers the code points in ug.orth. 2) the font pattern in the query is wrong. 3) ug.orth has a bug.> (2) Is the any way to tell/force fontconfig to use a font for the given > language environment / writing system / scripts?You can put the following config to $HOME/.fonts.conf: <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "/etc/fonts/fonts.dtd"> <fontconfig> <alias> <family>serif</family> <prefer> <family>Your Font Family Name</family> </prefer> </alias> <alias> <family>sans-serif</family> <prefer> <family>Your Font Family Name</family> </prefer> </alias> <alias> <family>monospace</family> <prefer> <family>Your Font Family Name</family> </prefer> </alias> </fontconfig> or if you want to use your font for Uyghur only: <match> <test name="lang" compare="contains"> <string>ug</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend"> <string>Your Font Family Name</string> </edit> </match> and similar for serif and monospace too. -- Akira TAGOH
On Mon, Mar 12, 2012 at 10:43 PM, Akira TAGOH <akira at tagoh.org> wrote:> Please be aware that no one can tell you the better answer without the > details. this is a rough answer for the rough question. if you aren''t > comfortable with it, please give us what you did, what happened and > what you were expected. otherwise there are no way to see what''s wrong > in fontconfig. > > On Tue, Mar 13, 2012 at 9:30 AM, Eagle Burkut <eagle.burkut at gmail.com> > wrote: > > So I am here to ask your help. I have couple of questions: > > > > (1) Why does the fontconfig select the font poorly here, even selecting a > > font which does not support the required code points and or glyphs? > > The possible reason is, 1) there are no better fonts against the > query. which covers the code points in ug.orth. 2) the font pattern in > the query is wrong. 3) ug.orth has a bug. >1) Yes, there is already a better font available. 2) Probably 3) ug.orth has no bug. we have recently fixed it.> > > (2) Is the any way to tell/force fontconfig to use a font for the given > > language environment / writing system / scripts? > > You can put the following config to $HOME/.fonts.conf: >The problem starts immediately when you boot your PC with CD to install the system. The installation screen itself is very buggy. I think it is because of the bugs in the fontconfig itself. Before you finish installing the system, there is no way to put these files into those folder (which does not exist at the time you are installing the system from the CD).> > <?xml version="1.0"?> > <!DOCTYPE fontconfig SYSTEM "/etc/fonts/fonts.dtd"> > <fontconfig> > <alias> > <family>serif</family> > <prefer> > <family>Your Font Family Name</family> > </prefer> > </alias> > <alias> > <family>sans-serif</family> > <prefer> > <family>Your Font Family Name</family> > </prefer> > </alias> > <alias> > <family>monospace</family> > <prefer> > <family>Your Font Family Name</family> > </prefer> > </alias> > </fontconfig> > > or if you want to use your font for Uyghur only: > <match> > <test name="lang" compare="contains"> > <string>ug</string> > </test> > <test name="family"> > <string>sans-serif</string> > </test> > <edit name="family" mode="prepend"> > <string>Your Font Family Name</string> > </edit> > </match> > > and similar for serif and monospace too. > > -- > Akira TAGOH-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120312/f2d38cdf/attachment.html>
Please explain what the font you are expecting to see and what the font is actually selected. it''s hard to figure out what''s going on there. try: $ fc-match sans-serif or $ fc-match sans-serif:lang=ug perhaps. or whatever the alias font you are suspecting. On Tue, Mar 13, 2012 at 1:31 PM, Eagle Burkut <eagle.burkut at gmail.com> wrote:> On Mon, Mar 12, 2012 at 10:43 PM, Akira TAGOH <akira at tagoh.org> wrote: >> >> Please be aware that no one can tell you the better answer without the >> details. this is a rough answer for the rough question. if you aren''t >> comfortable with it, please give us what you did, what happened and >> what you were expected. otherwise there are no way to see what''s wrong >> in fontconfig. >> >> On Tue, Mar 13, 2012 at 9:30 AM, Eagle Burkut <eagle.burkut at gmail.com> >> wrote: >> > So I am here to ask your help. I have couple of questions: >> > >> > (1) Why does the fontconfig select the font poorly here, even selecting >> > a >> > font which does not support the required code points and or glyphs? >> >> The possible reason is, 1) there are no better fonts against the >> query. which covers the code points in ug.orth. 2) the font pattern in >> the query is wrong. 3) ug.orth has a bug. > > > 1) Yes, there is already a better font available. > 2) Probably > 3) ug.orth has no bug. we have recently fixed it. > >> >> >> > (2) Is the any way to tell/force fontconfig to use a font for the given >> > language environment / writing system / scripts? >> >> You can put the following config to $HOME/.fonts.conf: > > > The problem starts immediately when you boot your PC with CD to install the > system. The installation screen itself is very buggy. I think it is because > of the bugs in the fontconfig itself. > > Before you finish installing the system, there is no way to put these files > into those folder (which does not exist at the time you are installing the > system from the CD). > >> >> >> <?xml version="1.0"?> >> <!DOCTYPE fontconfig SYSTEM "/etc/fonts/fonts.dtd"> >> <fontconfig> >> ?<alias> >> ? ?<family>serif</family> >> ? ?<prefer> >> ? ? ? ?<family>Your Font Family Name</family> >> ? ?</prefer> >> ?</alias> >> ?<alias> >> ? ?<family>sans-serif</family> >> ? ?<prefer> >> ? ? ? ?<family>Your Font Family Name</family> >> ? ?</prefer> >> ?</alias> >> ?<alias> >> ? ?<family>monospace</family> >> ? ?<prefer> >> ? ? ? ?<family>Your Font Family Name</family> >> ? ?</prefer> >> ?</alias> >> </fontconfig> >> >> or if you want to use your font for Uyghur only: >> ?<match> >> ? ?<test name="lang" compare="contains"> >> ? ? ?<string>ug</string> >> ? ?</test> >> ? ?<test name="family"> >> ? ? ? ?<string>sans-serif</string> >> ? ?</test> >> ? ?<edit name="family" mode="prepend"> >> ? ? ? ?<string>Your Font Family Name</string> >> ? ?</edit> >> ?</match> >> >> and similar for serif and monospace too. >> >> -- >> Akira TAGOH-- Akira TAGOH
On Tue, Mar 13, 2012 at 12:00 AM, Akira TAGOH <akira at tagoh.org> wrote:> Please explain what the font you are expecting to see and what the > font is actually selected. it''s hard to figure out what''s going on > there. > > try: > $ fc-match sans-serif > > or > > $ fc-match sans-serif:lang=ug > > perhaps. or whatever the alias font you are suspecting.Attached are 3 pictures: (1) FontConfig.png -- the correct ug.orth file Uyghur code definition (2) KacstOne.png -- the KacstOne font, which supports all code points required by Uyghur. (3) DejaVuSans.png --- the current DejaVu Sans font, which is used by the Ubuntu system to display Uyghur, and in which 4 code points are missing. My question is that, while the KacstOne font covers all ug.orth coverage, why FontConfig picks up DejaVu Sans font, which does not cover all ug.orth coverage? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120313/a04fa0ba/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: FontConfig.png Type: image/png Size: 2711 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120313/a04fa0ba/attachment-0003.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: KacstOne.png Type: image/png Size: 42504 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120313/a04fa0ba/attachment-0004.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: DejaVuSans.png Type: image/png Size: 56956 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120313/a04fa0ba/attachment-0005.png>
On Tue, Mar 13, 2012 at 2:33 PM, Eagle Burkut <eagle.burkut at gmail.com> wrote:> My question is that, while the KacstOne font covers all ug.orth coverage, > why FontConfig picks up DejaVu Sans font, which does not cover all ug.orth > coverage?If it''s the result on 2.9.0, try to run fc-cache -f /path/to/dejavu. otherwise it''s no wonder because the fix of ug.orth isn''t in 2.8.0 or any earlier versions. -- Akira TAGOH
On Tue, Mar 13, 2012 at 12:00 AM, Akira TAGOH <akira at tagoh.org> wrote:> Please explain what the font you are expecting to see and what the > font is actually selected. it''s hard to figure out what''s going on > there. > > try: > $ fc-match sans-serif > > or > > $ fc-match sans-serif:lang=ug > >I used Ubuntu 12.04 which has the correct ug.orth file, and I set my system language to Uyghur, and attached the screen shots. You can see from the desktop screen that, the font used is still the unsupportive DejaVu Sans font. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120313/dfe5e355/attachment-0001.htm> -------------- next part -------------- A non-text attachment was scrubbed... Name: terminal.png Type: image/png Size: 16119 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120313/dfe5e355/attachment-0002.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: desktop.png Type: image/png Size: 264938 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120313/dfe5e355/attachment-0003.png>
Are you sure Unity uses the alias name for them to look up a font? as you said, fc-match works at least. I don''t see any fault in fontconfig in that sense. You could get more details if you run Unity with FC_DEBUG=4. but it may gives you a lot of logs. On Tue, Mar 13, 2012 at 2:53 PM, Eagle Burkut <eagle.burkut at gmail.com> wrote:> On Tue, Mar 13, 2012 at 12:00 AM, Akira TAGOH <akira at tagoh.org> wrote: >> >> Please explain what the font you are expecting to see and what the >> font is actually selected. it''s hard to figure out what''s going on >> there. >> >> try: >> $ fc-match sans-serif >> >> or >> >> $ fc-match sans-serif:lang=ug >> > > I used Ubuntu 12.04 which has the correct ug.orth file, and I set my system > language to Uyghur, and attached the screen shots. > > You can see from the desktop screen that, the font used is still the > unsupportive DejaVu Sans font.-- Akira TAGOH
On Tue, Mar 13, 2012 at 1:29 AM, Akira TAGOH <akira at tagoh.org> wrote:> Are you sure Unity uses the alias name for them to look up a font?I have no idea about this.> as > you said, fc-match works at least. I don''t see any fault in fontconfig > in that sense. >Does my screen shots prove that the fontconfig and ug.orth are working correctly to select the correct font for my language? If yes, then, does this bug come from Unity or Ubuntu system itself?> > You could get more details if you run Unity with FC_DEBUG=4. but it > may gives you a lot of logs.I do not know how to do this. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120313/6d16857f/attachment.html>
On Tue, Mar 13, 2012 at 3:36 PM, Eagle Burkut <eagle.burkut at gmail.com> wrote:> Does my screen shots prove that the fontconfig and ug.orth are working > correctly to select the correct font for my language? > > If yes, then, does this bug come from Unity or Ubuntu system itself?Well, you should already have an answer for that. you could try other applications. if it doesn''t work on Unity only, something wrong in Unity then. -- Akira TAGOH
On Tue, Mar 13, 2012 at 4:13 AM, Akira TAGOH <akira at tagoh.org> wrote:> > Well, you should already have an answer for that. you could try other > applications. if it doesn''t work on Unity only, something wrong in > Unity then. > > -- > Akira TAGOH >I used Gnome instead of Unity, and unfortunately, I still have the same bug on Gnome. Seems there is still something wrong on FontConfig and Fonts side. What do you think? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120313/2dd36e47/attachment.htm>
I should look at the screenshot carefully, that looks like a rendering bug though. how did you figure out it''s from DejaVu Sans? does it work if you specify kacstOne explicitly on the font preferences for GNOME say? On Tue, Mar 13, 2012 at 9:59 PM, Eagle Burkut <eagle.burkut at gmail.com> wrote:> On Tue, Mar 13, 2012 at 4:13 AM, Akira TAGOH <akira at tagoh.org> wrote: >> >> >> Well, you should already have an answer for that. you could try other >> applications. if it doesn''t work on Unity only, something wrong in >> Unity then. >> >> -- >> Akira TAGOH > > > I used Gnome instead of Unity, and unfortunately, I still have the same bug > on Gnome. Seems there is still something wrong on FontConfig and Fonts side. > What do you think?-- Akira TAGOH
On Tue, Mar 13, 2012 at 8:26 AM, Akira TAGOH <akira at tagoh.org> wrote:> I should look at the screenshot carefully, that looks like a rendering > bug though. how did you figure out it''s from DejaVu Sans?There are only very few (probably just 2-3) fonts on Ubuntu system which supports Arabic/Uyghur and I studied the shape of individual glyphs of each font carefully. And I believe it is just DejaVu sans, nothing else.> does it work > if you specify kacstOne explicitly on the font preferences for GNOME > say?I will try that later when I go home today and report to you the results. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120313/663b72c5/attachment.htm>