WebKit freetype2 font backend doesn't support "locl" tables
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Webkit |
New
|
Medium
|
|||
webkit (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Currently, Ubuntu Lucid webkit package is compiled with the default setting for --with-font-backend ./configure option (freetype). However, "locl" lookup tables, as used for Serbian glyphs and present in DejaVu fonts (most notably with letters бгдпт in DejaVu Serif Italic from ttf-dejavu-extra package) are not supported so pages render with forms unfamiliar to Serbian readers (well, familiar, but very hard to read).
If --with-
To easily see the difference, you can do:
$ pango-view --font="DejaVu Serif Italic 64" --text "бгдпт" --language=sr
$ pango-view --font="DejaVu Serif Italic 64" --text "бгдпт" --language=ru
http://
https:/
Good test-case is visiting http://
Bug #248072 is an old bug asking for Pango usage and it seems at least part of this was reverted for Lucid (or earlier).
If there are really no drawbacks to using Pango, I'm sure many complex-script users would appreciate pango backend over the freetype2 one.
Данило Шеган (danilo) wrote : | #1 |
So, it seems Pango font backend is in a very bad shape, so we should not use it by default. One of the bugs I've seen myself is https:/
When https:/
In bugs.webkit.org/ #37984, Mrobinson-d (mrobinson-d) wrote : | #3 |
Created attachment 71970
Test case
I've attached a test case, which I think demonstrates the problem here more directly. To run the test case call LC_ALL=
In bugs.webkit.org/ #37984, Данило Шеган (danilo) wrote : | #4 |
Just FTR, it seems to work as you expect in Epiphany. I.e. first case is rendered correctly (as I'd expect it), and the second is not. I was not aware of this CSS property (I see that it's non-standard, so basically, thanks for the tip :).
In bugs.webkit.org/ #37984, Nicolas-mailhot-laposte (nicolas-mailhot-laposte) wrote : | #5 |
However, since locl is a "smart font" OpenType feature, and Pango's raison d'être is to implement those features (while freetype alone only provides basic TrueType decoding), it's not really surprising that it fails with the freetype backend.
You do need pango (or more precisely harfbuzz, which is used by pango) to handle this level of font smartness.
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #6 |
(In reply to comment #0)
> Created an attachment (id=54046) [details]
> Serbian and regular cursive forms for some Cyrillic letters
>
> Compiling WebKitGtk with the default freetype backend results in "locl" tables in opentype fonts not being used. Compiling it with the pango backend instead makes it work.
>
It seems that this is not exactly "locl" table problem. The "locl" table for Cyrillic in DeJavu Serif has only one entry is U+0431(CYRILLIC SMALL LETTER BE) --> U+F6C5
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #7 |
I just figured out that cursive forms are in DejaVuSerif-
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #8 |
(In reply to comment #5)
> I just figured out that cursive forms are in DejaVuSerif-
To clarify, Martin's testcase has nothing to do with 'locl', but Danilo's original bug report is 'locl' related
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #9 |
So to solve the original bug report. It seems to me that there are two tasks to be done:
1. when "style=
2. lookup DejavVu-
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #10 |
Created attachment 77714
'locl' works
my dirty hack showing Martin's test case
I'll find time to clean the code and send patch
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #11 |
Created attachment 77736
roposed patch
use 'locl' table, if current locale (and corresponding language and script in the font) has it
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #12 |
Created attachment 77739
proposed patch
if there is no FcPattern, that is, it's CustomFont, should return early
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #13 |
Created attachment 77796
proposed patch
use FT_Face->family instead of FcPattern, so that we can handle both FontPlatformData and CustomFont now
In bugs.webkit.org/ #37984, Mrobinson-d (mrobinson-d) wrote : | #14 |
Comment on attachment 77796
proposed patch
View in context: https:/
> WebCore/
> + PangoFontDescri
> + if (!pangoDescription)
> + return false;
> +
I'm pretty sure this won't work with custom fonts, since IIUC Pango just does a Fontconfig lookup. It makes more sense to bail out for fonts with no FcPattern.
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #15 |
(In reply to comment #12)
> (From update of attachment 77796 [details])
> View in context: https:/
>
> > WebCore/
> > + PangoFontDescri
> > + if (!pangoDescription)
> > + return false;
> > +
>
> I'm pretty sure this won't work with custom fonts, since IIUC Pango just does a Fontconfig lookup. It makes more sense to bail out for fonts with no FcPattern.
As we discussed on IRC, I tried [1] on Ubuntu. It worked like what on my Mac.
I read a little bit Pango source code. It seems to me that there is no way to create PangoFont or PangoFcFont from FT_Face without adding new API to Pango.
And the reason why my code works is that Pango can use FreeType without using FontConfig. The PangoFcFont is kinda misnomer, I think. PangoFcFont is can be Xft font, FreeType Font, or FontConfig+FreeType font
[1] http://
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #16 |
Created attachment 77994
test case to show why we should lang attribute
a test case to show why we should lang attribute. See this with FireFox 4.0 beta
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #17 |
Created attachment 77997
screenshot of the lang attribute test case in ff 4.0 beta 8
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #18 |
Created attachment 78101
update the proposed patch
add style name to FontDescription so that http://
The way we load font:
pango_
doesn't not require FcPattern input, it will create FcPattern inside PangoFcFont
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #19 |
Created attachment 78222
harfbuzz version
same as 78101, use harfbuzz, Pango functions are used to convert locale string to font languge string and to find script in font
In bugs.webkit.org/ #37984, "freedom" Koan-Sin Tan (koansin-tan) wrote : | #20 |
Created attachment 78501
patch to import harfbuzz
1. use 'Tools/
2. harfbuzz is located at WebKit/
3. use in $BUILD/
Changed in webkit: | |
status: | Unknown → New |
Changed in webkit: | |
importance: | Unknown → Medium |
In bugs.webkit.org/ #37984, Behdad-t (behdad-t) wrote : | #21 |
This should be addressed after porting to harfbuzz-ng. And even then, just switching to the complex path if 'locl' is desired.
In bugs.webkit.org/ #37984, Dominik Röttsches (drott) wrote : | #22 |
Martin, does this issue still require some work? Is it still relevant?
In bugs.webkit.org/ #37984, Mrobinson-d (mrobinson-d) wrote : | #23 |
(In reply to comment #20)
> Martin, does this issue still require some work? Is it still relevant?
Yes, as Behdad says we need to switch to the complex text path when appropriate. Behdad probably has more information about when the right time to do that is.
In bugs.webkit.org/ #37984, Behdad-t (behdad-t) wrote : | #24 |
(In reply to comment #21)
> (In reply to comment #20)
> > Martin, does this issue still require some work? Is it still relevant?
>
> Yes, as Behdad says we need to switch to the complex text path when appropriate. Behdad probably has more information about when the right time to do that is.
On Chrome Linux and Android we already switched to harfbuzz-ng. So, first step is to figure out who still uses harfbuzz.old and switch them over.
After that, it's just a matter of developing the heuristics. I personally think that we should get rid of the fastpath and always do complex text processing (requires adding new caches). But that's far from where we are right now.
In bugs.webkit.org/ #37984, Mrobinson-d (mrobinson-d) wrote : | #25 |
(In reply to comment #22)
> On Chrome Linux and Android we already switched to harfbuzz-ng. So, first step is to figure out who still uses harfbuzz.old and switch them over.
To my knowledge, all upstream WebKit ports using harfbuzz directly are using harfbuzz-ng.
In bugs.webkit.org/ #37984, Behdad-t (behdad-t) wrote : | #26 |
(In reply to comment #23)
> (In reply to comment #22)
>
> > On Chrome Linux and Android we already switched to harfbuzz-ng. So, first step is to figure out who still uses harfbuzz.old and switch them over.
>
> To my knowledge, all upstream WebKit ports using harfbuzz directly are using harfbuzz-ng.
How about the Qt port?
If that is indeed the case we should remove all harfbuzz.old helper code.
In bugs.webkit.org/ #37984, Dominik Röttsches (drott) wrote : | #27 |
Ossy, Simon - how about Qt? Do you still need the harfbuzz.old code or can it go away?
In bugs.webkit.org/ #37984, Hausmann (hausmann) wrote : | #28 |
(In reply to comment #25)
> Ossy, Simon - how about Qt? Do you still need the harfbuzz.old code or can it go away?
It can go away AFAICS. Currently we use Qt for shaping (which uses Harfbuzz, but that's outside of WebKit). Pierre has done some very promising research towards using harfbuzz-ng directly in the Qt port in WebKit and I'd say if things continue the way they do then we're likely to switch to that in the future. But we are not currently using any existing Harfbuzz code path in WebKit, so feel free to change it as you like ;)
In bugs.webkit.org/ #37984, Dominik Röttsches (drott) wrote : | #29 |
(In reply to comment #22)
> After that, it's just a matter of developing the heuristics. I personally think that we should get rid of the fastpath and always do complex text processing (requires adding new caches). But that's far from where we are right now.
Get rid of the simple path altogether, in WebKit?
Can you elaborate a little bit on the heuristics you have in mind? In this case, just something that's based on locales that need lookups in the locl table (like apparently Serbian, as in the original report)? Or something more generic?
In bugs.webkit.org/ #37984, Nicolas-mailhot-laposte (nicolas-mailhot-laposte) wrote : | #30 |
IMHO heuristics are doomed to fail badly sooner or later. The simple path is wishful thinking
Complex font features are not limited to specific locales such as Serbian, Serbian is just a locale that needs it more than others. Complex features adoption start there and then spreads elsewhere (some people thought unicode was not necessary for western european locale support, and then German speakers standardized upercase ss, oops)
It's much safer to always use the complex codepath, instead of betting on some locales never using tech that is available anyway due to other locale needs. Now that the tools to create complex fonts are there, someone will find a way to use them even for the 'simplest' locales.
In bugs.webkit.org/ #37984, Behdad-t (behdad-t) wrote : | #31 |
(In reply to comment #27)
> (In reply to comment #22)
>
> > After that, it's just a matter of developing the heuristics. I personally think that we should get rid of the fastpath and always do complex text processing (requires adding new caches). But that's far from where we are right now.
>
> Get rid of the simple path altogether, in WebKit?
Yes, that's the way it should be IMO. The reason it's not possible right now, is because WebKit does not cache shaping results. As such, every time text is being shown, it's being shaped and shown. That's why supposedly the complex text path is "too slow" for common usage. With effective caching it's possible to turn full shaping on for all scripts. Indeed, that's what Firefox does.
> Can you elaborate a little bit on the heuristics you have in mind? In this case, just something that's based on locales that need lookups in the locl table (like apparently Serbian, as in the original report)? Or something more generic?
I don't have any heuristics in mind. You can start by adding Serbian, and then add other languages when people nag. You can tell I'm in the same camp as Nicolas though: even for Latin I think we should do full OpenType shaping.
In bugs.webkit.org/ #37984, Dominik Röttsches (drott) wrote : | #32 |
(In reply to comment #29)
Thanks, Behdad.
> > Get rid of the simple path altogether, in WebKit?
>
> Yes, that's the way it should be IMO. The reason it's not possible right now, is because WebKit does not cache shaping results. As such, every time text is being shown, it's being shaped and shown. That's why supposedly the complex text path is "too slow" for common usage. With effective caching it's possible to turn full shaping on for all scripts. Indeed, that's what Firefox does.
I don't know enough about it yet - but out of curiosity: would you have to cache the shaping coordinate results for arbitrary string length or is it a matter of caching the results for individual pairs of codepoints?
> I don't have any heuristics in mind. You can start by adding Serbian, and then add other languages when people nag.
We can call it the nag-heuristic :-)
In bugs.webkit.org/ #37984, Behdad-t (behdad-t) wrote : | #33 |
Hi Dominik,
Comments below. This is getting offtopic, so feel free to email me for followup discussion.
(In reply to comment #30)
> (In reply to comment #29)
>
> Thanks, Behdad.
>
> > > Get rid of the simple path altogether, in WebKit?
> >
> > Yes, that's the way it should be IMO. The reason it's not possible right now, is because WebKit does not cache shaping results. As such, every time text is being shown, it's being shaped and shown. That's why supposedly the complex text path is "too slow" for common usage. With effective caching it's possible to turn full shaping on for all scripts. Indeed, that's what Firefox does.
>
> I don't know enough about it yet - but out of curiosity: would you have to cache the shaping coordinate results for arbitrary string length or is it a matter of caching the results for individual pairs of codepoints?
No "pairs of codepoints"...
The way I would do is to start by simply caching the glyph list of each text run. When the text is changed, invalidate the cache.
Firefox goes one step further: they also cache the shaping result of individual words, so they can put the glyphs for a run together by looking up individual words. That has other issues, but can be made to work.
> > I don't have any heuristics in mind. You can start by adding Serbian, and then add other languages when people nag.
>
> We can call it the nag-heuristic :-)
+1!
In bugs.webkit.org/ #37984, Dominik Röttsches (drott) wrote : | #34 |
(In reply to comment #29)
> (In reply to comment #27)
> I don't have any heuristics in mind. You can start by adding Serbian, and then add other languages when people nag. You can tell I'm in the same camp as Nicolas though: even for Latin I think we should do full OpenType shaping.
I put this idea into bug 108074 for tracking.
In bugs.webkit.org/ #37984, G-duffner (g-duffner) wrote : | #35 |
(In reply to comment #28)
> IMHO heuristics are doomed to fail badly sooner or later. The simple path is wishful thinking
>
> Complex font features are not limited to specific locales such as Serbian, Serbian is just a locale that needs it more than others. Complex features adoption start there and then spreads elsewhere (some people thought unicode was not necessary for western european locale support, and then German speakers standardized upercase ss, oops)
>
> It's much safer to always use the complex codepath, instead of betting on some locales never using tech that is available anyway due to other locale needs. Now that the tools to create complex fonts are there, someone will find a way to use them even for the 'simplest' locales.
FWIW I’ve put together a test page for the locl features in EB Garamond. They are all “simple” locales (serbian, catalan, german and turkish).
In bugs.webkit.org/ #37984, Dominik Röttsches (drott) wrote : | #36 |
(In reply to comment #33)
> FWIW I’ve put together a test page for the locl features in EB Garamond. They are all “simple” locales (serbian, catalan, german and turkish).
>
> http://
Georg, thanks for these. Could you (e.g. on the page itself) explain a bit more what's supposed to happen if correct locl support is activated vs. what the page looks like if that's not the case?
In bugs.webkit.org/ #37984, G-duffner (g-duffner) wrote : | #37 |
(In reply to comment #34)
> (In reply to comment #33)
>
> > FWIW I’ve put together a test page for the locl features in EB Garamond. They are all “simple” locales (serbian, catalan, german and turkish).
> >
> > http://
>
> Georg, thanks for these. Could you (e.g. on the page itself) explain a bit more what's supposed to happen if correct locl support is activated vs. what the page looks like if that's not the case?
I’ve updated the page with an explanation and with a screenshot of the expected result.
In bugs.webkit.org/ #37984, G-duffner (g-duffner) wrote : | #38 |
(In reply to comment #35)
> (In reply to comment #34)
> > (In reply to comment #33)
> >
> > > FWIW I’ve put together a test page for the locl features in EB Garamond. They are all “simple” locales (serbian, catalan, german and turkish).
> > >
> > > http://
> >
> > Georg, thanks for these. Could you (e.g. on the page itself) explain a bit more what's supposed to happen if correct locl support is activated vs. what the page looks like if that's not the case?
>
> I’ve updated the page with an explanation and with a screenshot of the expected result.
On Chromium/Linux one locl is active, namely the one corresponding to your system’s locale. In my case the latter being de-AT, I get correct rendering for german examples but not only on the right but also on the left side (which should be english locl as declared in the header). I tested this by setting my OS to tr which resulted in correct rendering for all the Turkish examples and false for all the others.
In bugs.webkit.org/ #37984, Nicolas-mailhot-laposte (nicolas-mailhot-laposte) wrote : | #39 |
(In reply to comment #36)
> On Chromium/Linux one locl is active, namely the one corresponding to your system’s locale.
That's wrong, the browser should use the locl corresponding to the locale the run of text is marked with
(I suspect chromium has no locl awareness and it only "works" because it is unaware the system font stack is locl-compatible)
In bugs.webkit.org/ #37984, Dominik Röttsches (drott) wrote : | #40 |
(In reply to comment #35)
> I’ve updated the page with an explanation and with a screenshot of the expected result.
Thanks - that's a good starting point for creating some LayoutTests later.
In bugs.webkit.org/ #37984, G-duffner (g-duffner) wrote : | #41 |
(In reply to comment #38)
> (In reply to comment #35)
>
> > I’ve updated the page with an explanation and with a screenshot of the expected result.
>
> Thanks - that's a good starting point for creating some LayoutTests later.
(In reply to comment #37)
> (In reply to comment #36)
>
> > On Chromium/Linux one locl is active, namely the one corresponding to your system’s locale.
>
> That's wrong, the browser should use the locl corresponding to the locale the run of text is marked with
>
> (I suspect chromium has no locl awareness and it only "works" because it is unaware the system font stack is locl-compatible)
Thinking deeper about the above said, it looks, like this is not an issue of webkit any longer. The example of Chromium shows that locl is applied, just not the correct one because the browser doesn’t handle the lang-attribute correctly.
I think, we have to look into the browsers we use and file bugs at their trackers.
I did so for Chromium here: http://
In bugs.webkit.org/ #37984, Behdad-t (behdad-t) wrote : | #42 |
(In reply to comment #38)
> (In reply to comment #35)
>
> > I’ve updated the page with an explanation and with a screenshot of the expected result.
>
> Thanks - that's a good starting point for creating some LayoutTests later.
Right now HarfBuzzRun doesn't hold language and doesn't set language on the buffer.
This *is* a Webkit bug.
In bugs.webkit.org/ #37984, G-duffner (g-duffner) wrote : | #43 |
(In reply to comment #40)
> (In reply to comment #38)
> > (In reply to comment #35)
> >
> > > I’ve updated the page with an explanation and with a screenshot of the expected result.
> >
> > Thanks - that's a good starting point for creating some LayoutTests later.
>
> Right now HarfBuzzRun doesn't hold language and doesn't set language on the buffer.
>
> This *is* a Webkit bug.
Ok, then I’m very curious what’s going on in Chromium. Is there any other part of the program that can do something with Opentype features? Because the effects shown in the testpage can’t be replicated but with locl.
In bugs.webkit.org/ #37984, Behdad-t (behdad-t) wrote : | #44 |
(In reply to comment #41)
> (In reply to comment #40)
> > (In reply to comment #38)
> > > (In reply to comment #35)
> > >
> > > > I’ve updated the page with an explanation and with a screenshot of the expected result.
> > >
> > > Thanks - that's a good starting point for creating some LayoutTests later.
> >
> > Right now HarfBuzzRun doesn't hold language and doesn't set language on the buffer.
> >
> > This *is* a Webkit bug.
>
> Ok, then I’m very curious what’s going on in Chromium. Is there any other part of the program that can do something with Opentype features? Because the effects shown in the testpage can’t be replicated but with locl.
Yes, as you identified yourself, it applies locl, just not the right one. And to make it apply the right one a fix in webkit is needed. I'm not quite sure what you are talking about.
In bugs.webkit.org/ #37984, G-duffner (g-duffner) wrote : | #45 |
(In reply to comment #42)
> (In reply to comment #41)
> > (In reply to comment #40)
> > > (In reply to comment #38)
> > > > (In reply to comment #35)
> > > >
> > > > > I’ve updated the page with an explanation and with a screenshot of the expected result.
> > > >
> > > > Thanks - that's a good starting point for creating some LayoutTests later.
> > >
> > > Right now HarfBuzzRun doesn't hold language and doesn't set language on the buffer.
> > >
> > > This *is* a Webkit bug.
> >
> > Ok, then I’m very curious what’s going on in Chromium. Is there any other part of the program that can do something with Opentype features? Because the effects shown in the testpage can’t be replicated but with locl.
>
> Yes, as you identified yourself, it applies locl, just not the right one. And to make it apply the right one a fix in webkit is needed. I'm not quite sure what you are talking about.
I’m sorry, I probably haven’t understood well the part of HarfBuzzRun "doesn't hold language and doesn't set language on the buffer".
I understood it in a way that HB isn’t responsible for the locl feature effects we see.
I’m confused. But nevermind, I’m sure you’re doing the right thing.
In bugs.webkit.org/ #37984, Behdad-t (behdad-t) wrote : | #46 |
(In reply to comment #43)
> (In reply to comment #42)
> > (In reply to comment #41)
> > > (In reply to comment #40)
> > > > (In reply to comment #38)
> > > > > (In reply to comment #35)
> > > > >
> > > > > > I’ve updated the page with an explanation and with a screenshot of the expected result.
> > > > >
> > > > > Thanks - that's a good starting point for creating some LayoutTests later.
> > > >
> > > > Right now HarfBuzzRun doesn't hold language and doesn't set language on the buffer.
> > > >
> > > > This *is* a Webkit bug.
> > >
> > > Ok, then I’m very curious what’s going on in Chromium. Is there any other part of the program that can do something with Opentype features? Because the effects shown in the testpage can’t be replicated but with locl.
> >
> > Yes, as you identified yourself, it applies locl, just not the right one. And to make it apply the right one a fix in webkit is needed. I'm not quite sure what you are talking about.
>
> I’m sorry, I probably haven’t understood well the part of HarfBuzzRun "doesn't hold language and doesn't set language on the buffer".
> I understood it in a way that HB isn’t responsible for the locl feature effects we see.
HarfBuzz applies 'locl'. It needs to be told the text language. When it's not, it uses default language.
HarfBuzzRun is a Webkit abstraction around HarfBuzz shaper. It's part of the glue code connecting Webkit HarfBuzz. As such, it must collect the correct language from other Webkit layers and pass it to HarfBuzz. It's not doing that right now.
> I’m confused. But nevermind, I’m sure you’re doing the right thing.
Yes, I believe the issue is clear now.
In bugs.webkit.org/ #37984, G-duffner (g-duffner) wrote : | #47 |
(In reply to comment #44)
> (In reply to comment #43)
> > (In reply to comment #42)
> > > (In reply to comment #41)
> > > > (In reply to comment #40)
> > > > > (In reply to comment #38)
> > > > > > (In reply to comment #35)
> > > > > >
> > > > > > > I’ve updated the page with an explanation and with a screenshot of the expected result.
> > > > > >
> > > > > > Thanks - that's a good starting point for creating some LayoutTests later.
> > > > >
> > > > > Right now HarfBuzzRun doesn't hold language and doesn't set language on the buffer.
> > > > >
> > > > > This *is* a Webkit bug.
> > > >
> > > > Ok, then I’m very curious what’s going on in Chromium. Is there any other part of the program that can do something with Opentype features? Because the effects shown in the testpage can’t be replicated but with locl.
> > >
> > > Yes, as you identified yourself, it applies locl, just not the right one. And to make it apply the right one a fix in webkit is needed. I'm not quite sure what you are talking about.
> >
> > I’m sorry, I probably haven’t understood well the part of HarfBuzzRun "doesn't hold language and doesn't set language on the buffer".
> > I understood it in a way that HB isn’t responsible for the locl feature effects we see.
>
> HarfBuzz applies 'locl'. It needs to be told the text language. When it's not, it uses default language.
>
> HarfBuzzRun is a Webkit abstraction around HarfBuzz shaper. It's part of the glue code connecting Webkit HarfBuzz. As such, it must collect the correct language from other Webkit layers and pass it to HarfBuzz. It's not doing that right now.
>
> > I’m confused. But nevermind, I’m sure you’re doing the right thing.
>
> Yes, I believe the issue is clear now.
And I too understand it now. Thank you!
In bugs.webkit.org/ #37984, Agoldmints (agoldmints) wrote : | #48 |
I'm going to try to take this one on. I think at this point it's a matter of plumbing the language attribute through, and then calling hb_buffer_
In bugs.webkit.org/ #37984, Agoldmints (agoldmints) wrote : | #49 |
Created attachment 439060
Patch
In bugs.webkit.org/ #37984, Agoldmints (agoldmints) wrote : | #50 |
Created attachment 442519
Patch
In bugs.webkit.org/ #37984, Mrobinson-d (mrobinson-d) wrote : | #51 |
Comment on attachment 442519
Patch
View in context: https:/
This is great! Looks like the test is still failing on Mac and this should handle a failed call to hb_language_
> Source/
> + hb_language_t language = hb_language_
I think it would be better to do this here:
hb_language_
This would allow you to avoid the reinterpret_cast.
It seems like this call should check for and handle (not set the language below) the situation where HB_LANGUAGE_INVALID is returned here.
In bugs.webkit.org/ #37984, carloslp (carloslp) wrote : | #52 |
Comment on attachment 442519
Patch
The in-test GTK LayoutTest EWS at the UAT (still behind a firewall) found a new failure with this patch:
imported/
Created attachment 54046
Serbian and regular cursive forms for some Cyrillic letters
Compiling WebKitGtk with the default freetype backend results in "locl" tables in opentype fonts not being used. Compiling it with the pango backend instead makes it work.
Example HTML that demonstrates the problem is the following: compare rendering in Firefox and Epiphany (when Serbian locale is active on your system, eg. set LC_ALL=sr_RS.UTF-8 in an env where you start firefox/epiphany from): font-style: italic; font-family:serif; font-size: 300%;" lang="sr">бгдпт</p>
<p style="
To clearly see what differences are expected, you can test it directly with pango tools:
$ pango-view --font="DejaVu Serif Italic 64" --text "бгдпт" --language=sr
$ pango-view --font="DejaVu Serif Italic 64" --text "бгдпт" --language=ru
(output of these attached for reference)
DejaVu Serif is one of the fonts that has such tables for Romanian and Serbian language. On Ubuntu (most likely Debian as well), it's in ttf-dejavu-extras package, and on Fedora I hear it's in dejavu- serif-fonts- 2.30. Upstream is http:// dejavu- fonts.org
Originally filed as https:/ /bugs.launchpad .net/ubuntu/ +source/ webkit/ +bug/560795 thinking we should just change the default font backend to pango, but Xan told me there are a lot of bugs in the pango layout that it'd be better to fix the freetype backend.