Display of double-overstrike character in various browsers
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !
15 posts
• Page 2 of 2 • 1, 2
Re: Display of double-overstrike character in various browse
If it displays correctly now, it is simply because Stefan is now using the APL385 Unicode font. No?
- paulmansour
- Posts: 420
- Joined: Fri Oct 03, 2008 4:14 pm
Re: Display of double-overstrike character in various browse
kai wrote:No way they are going to change that any time soon,
The current behaviour is by design. All mainstream browsers (even Firefox!) use the HarfBuzz text layout engine, but with varying configurations. All Chromium-based software (Chrome, Edge, Opera, Vivaldi, Brave, Amazon Silk, Samsung Internet, Dyalog HTMLRenderer, Electron, WebView2, DotNetBrowser, Qt, etc. etc.) tell HarfBuzz to prefer an attempt at composing two characters from the requested font rather than getting a pre-composed character from a different font. All Gecko-based software (Firefox, SeaMonkey, Thunderbird) instead tell HarfBuzz to attempt at getting a missing character from a different font, before attempting to compose it.
Both approaches are reasonable. The former prefers overall stylistic consistency over internal glyph precision, while the latter prefers correct rendering of individual glyphs at the cost of a potentially uneven "look".
paulmansour wrote:If it displays correctly now, it is simply because Stefan is now using the APL385 Unicode font. No?
Yes, the fix is simple: Specify a font that has the characters you need, and HarfBuzz will not need to compromise for neither Blink nor Gecko. Don't forget to make the font available on your server in case the client doesn't have it. Here's the CSS that Stefan recently began using:
- Code: Select all
@font-face {
font-family: "codefont";
src: local("APL385 Unicode"),
url(APL385.ttf) format("truetype");
}
/* Use the code font where relevant. */
t, code, kbd, samp, pre, .output.text_html span {
font-family: codefont!important
}
-
Adam|Dyalog - Posts: 135
- Joined: Thu Jun 25, 2015 1:13 pm
Re: Display of double-overstrike character in various browse
The thing is that the fix is not simple. If you are the author of the web page that needs to displays APL characters, and the only characters you need to display as part of the APL Code (like comments, quoted strings and so on) are covered by APL385, then, by all means, a bit of CSS, the font hosted on your server and you're good to go.
But what if the APL code contains Chinese comments? Or the APL program you wrote contains extensive quotes from a Sanskrit text? Or if the programs makes use of all the latest and greatest emojis the Unicode committee keeps adding? Is anybody busy adding new glyphs to APL385?
Also: what if you are not the maintainer of the web page? Sites like github, gitlab are very unlikely to upgrade their CSSs because Harfbuzz mangles a few of the APL glyphs, yet they are used to host large swathes of APL code... How do you fix this:
?
The way I solved the problem is by lowering my beauty standards and by teaching myself to recognise the few funny patterns which don't make sense in proper APL.
But what if the APL code contains Chinese comments? Or the APL program you wrote contains extensive quotes from a Sanskrit text? Or if the programs makes use of all the latest and greatest emojis the Unicode committee keeps adding? Is anybody busy adding new glyphs to APL385?
Also: what if you are not the maintainer of the web page? Sites like github, gitlab are very unlikely to upgrade their CSSs because Harfbuzz mangles a few of the APL glyphs, yet they are used to host large swathes of APL code... How do you fix this:
?
The way I solved the problem is by lowering my beauty standards and by teaching myself to recognise the few funny patterns which don't make sense in proper APL.
-
StefanoLanzavecchia - Posts: 109
- Joined: Fri Oct 03, 2008 9:37 am
Re: Display of double-overstrike character in various browse
But what if the APL code contains Chinese comments? Or the APL program you wrote contains extensive quotes from a Sanskrit text?
That should "just work". HarfBuzz will fall back to a font that does have those characters.
As per the above; no need.Is anybody busy adding new glyphs to APL385?
Also: what if you are not the maintainer of the web page? Sites like github, gitlab are very unlikely to upgrade their CSSs because Harfbuzz mangles a few of the APL glyphs, yet they are used to host large swathes of APL code... How do you fix this:
Install a browser user style extension (I use Stylus) and add the style:
- Code: Select all
.blob-code-inner{font-family:APL385 Unicode}
-
Adam|Dyalog - Posts: 135
- Joined: Thu Jun 25, 2015 1:13 pm
Re: Display of double-overstrike character in various browse
As far as I am aware, mobile browsers don't allow extensions. Nor many corporate controlled browsers.
-
StefanoLanzavecchia - Posts: 109
- Joined: Fri Oct 03, 2008 9:37 am
15 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group