Mactype: Font rendering in firefox 62.0 compared to Cent Browser 3.5.3.50

Created on 21 Aug 2018  路  28Comments  路  Source: snowie2000/mactype

Hi!
I use MacType for few years now and it always worked more or less without any problems. Recently I wanted to switch from Cent Browser (directwrite disabled) to Firefox, but MacType font rendering is somewhat wrong. I remember that around version 55 everything worked great with right flags, but now it looks... just wrong.

I read about changing flags, so I changed following flags:
gfx.content.azure.backends=cairo
gfx.canvas.azure.backends=cairo
gfx.direct2d.disabled=true

And the result is... somewhat wrong. Let the screenshots speak for themselves.

Reddit:
Firefox
Cent
Google:
Firefox
Cent
Github:
Firefox
Cent
You get the idea.

Firefox version
Cent version
MacType version

Windows 10 1607 Build 14393.2248

Could someone confirm it's problem with MacType or my machine? And maybe give some solutions?

Cheers,
istir

waiting user feedback

All 28 comments

For now it looks like default windows rendering when installed in VMware looks better than MacType

Host-Windows10-MacType
VMWare:
Stock Windows rendering
MacType with direct2d.disabled=true and my .ini

Back to Host-Windows:
after returning gfx.content.azure.backends and gfx.canvas.azure.backends to default values font looks better but it's still not the same as Cent Browser, fonts are lighter, even with the same fonts used in both Cent and Firefox. I probably could just mess with MacType settings but then fonts would look bold system wide.

Hi @istir... the FF screenshots look like directwrite rendering to me.

can anyone else confirm the workaround is no longer working in FF 62+?

I had somewhat kerning problem using Mactype in FF62..and then I returned to the directwrite.

@Mahayu is it possible to post a screenshot of the kerning problems?

@snowie2000 @Mahayu I've updated the release notes of MacType to include instructions for enabling MacType/GDI in Chrome (CentBrowser) and Firefox https://github.com/snowie2000/mactype/releases/tag/1.2018.917.0-beta2

I will post screenshots soon.
Do config files (ini) related to this problem? If so, I will show my config too.

@Mahayu yes please that would be great, thank you 馃槉

https://github.com/Mahayu/MMConfig/blob/master/MMConfig_Clear.ini
Here is my config file. The shots should be uploaded tomorrow or later today. (UTC +8)

default
You may see that the word "Windows" and "Works" are weird.
default
the word "malware"

Hmm.. are they "features"?

I got the point. Setting the page in 110% or higher magnification will cause mysterious kerning problems.

Setting to the 100% is OK for now.

Okay interesting. I can see what you mean but I can't reproduce with my ini settings (at 100%, 110%, 120%)
image

My ini file is attached if you want to try? I'm sure @snowie2000 will know! (no pressure 馃槣)
No Hinting.zip

This is actually font dependent.
@Mahayu You should rather compare the screenshot with and without MacType. And to my understanding, they should behave more or less the same. But this problem should go away if you enable DirectWrite.
This is because Windows GDI does not support sub-pixel positioning. (not sub-pixel rendering, which is partially supported in W7 and got full support in W10). The left edge of a character or a letter has to be placed in an integer coordinate value (i.e. pixel perfect)
If the previous letter ends in the first sub-pixel of a whole pixel, there will be two sub-pixels gap between it and the next letter. If the previous letter ends right at the edge of that pixel, there will be no gap or a whole pixel gap between them.

Windows has made a solution for that: hinting. It will stretch the letter a bit so that the right edge of the letter can end up using a whole pixel, which may mitigate the kerning problem in some situations. You could achieve the same result by enabling hinting of MacType.

Microsoft has added the sub-pixel positioning support to DirectWrite so it's not affected.

Actually, FreeType supports sub-pixel positioning, and I can put the letter to any sub-pixel of a whole pixel by calculating the correct sub-pixel arranging order (it can be complex, but it's possible). But even if we did that, there is still one major problem:
You can only select text from the beginning of a pixel, which means once you select a letter that's positioned in a sub-pixel position, all the letters after it have to be rearranged which will cause a jitter. And this is impossible to avoid.

What's interesting is that the hinting is really font dependent and it is written by font manufacturer by hand. It's not perfect. Sometimes, it fixes the problem, in other cases, it makes things worse.

@snowie2000 so why doesn't it do it on my ini? I've also got HintingMode=1 and EnableKerning=1

HintingMode=1 means disabling hinting.
EnableKerning is somewhat mysterious... I've never touched any code about it. Someone says it's buggy.

lol. still, both our inis say HintingMode=1... yet mine doesn't do it and Mahayu's does
There are a lot of font exceptions in Mahayu's ini

I'll test Mahayu's profile tomorrow to see if it makes any difference in my environment.
And about the kerning setting, if you enable that setting, MacType will use the information returned by GetKerningPairs or FT_GET_KERNING. For most fonts, they just simply don't support kerning.
So this setting may work, but I never had a chance to test it in real life.

Not sure why is that but when I had it set to basically anything other than direct2d1.1,cairo,skia it didn't work (like in my top post), but after setting it up like in updated readme it works great!

I created a gif showing different modes, feel free to use it somewhere!
https://i.imgur.com/6K1DTWN.gifv

@istir hmm I don't know! yay I'm glad it's working for you now 馃槉

qq 20180926140207
@Mahayu This is my result. (My chrome is not at the zoom ratio of 110%, so you are definitely using a monitor with HiDPI)
As you can see, my texts didn't suffer from the same problem because apparently, we are using different fonts for alphabet.

@snowie2000 would you mind sharing your ini file?

I was using the config provided here: https://github.com/snowie2000/mactype/issues/429#issuecomment-424300900

In that case, would you mind sharing the ini file you use on your Windows?

It's not about the profile I'm using, it's about the font you're using in your browser.

Got a little bit time to reply.

My font is Arial, version 7.00.(Although I want to replace it with Helvetica or something other)

Trying to turn on the hinting for Arial later.

And the Directwrite under FF 62 is not that bad, everything goes smoothly after enabling it.

I'm about to close this thread 'cause it's not going anywhere 馃槣 ... Is there anything else left to be done?

Closing as no further action. Please let me know if that's wrong

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Skyyblaze picture Skyyblaze  路  5Comments

zhengbli picture zhengbli  路  3Comments

TianLi-520 picture TianLi-520  路  3Comments

l19980623 picture l19980623  路  5Comments

cricrazy picture cricrazy  路  4Comments