Fonts: Difference between revisions

Jump to navigation Jump to search
4,201 bytes added ,  12:52, 20 January 2023
(update Iosevka)
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
With the prevalence of [[Unicode]], many systems render APL legibly out-of-the-box. However, for a uniform appearance, the font should be designed with APL in mind.<ref>Phil Chastney: ''[https://web.archive.org/web/20161005120746/http://www.chastney.com/~philip/SImPL/APL_fonts_are_different.pdf APL fonts are different]''
With the prevalence of [[Unicode]], many systems render APL legibly out-of-the-box. However, for a uniform appearance, the font should be designed with APL in mind.<ref>Phil Chastney: ''[https://web.archive.org/web/20161005120746/http://www.chastney.com/~philip/SImPL/APL_fonts_are_different.pdf APL fonts are different]''
</ref> This article lists some fonts that are suited for APL.
</ref> This article lists some fonts that are suited for APL, and shows how to use them.
== Monospace ==
== Monospace ==
{|class=wikitable
{|class=wikitable
Line 7: Line 7:
| [https://www.ibm.com/us-en/marketplace/apl2 APL2 Unicode] || [https://www.ibm.com/account/reg/us-en/signup?formid=urx-32206 IBM] || Straight from IBM typewriter terminals with oblique letters. ||
| [https://www.ibm.com/us-en/marketplace/apl2 APL2 Unicode] || [https://www.ibm.com/account/reg/us-en/signup?formid=urx-32206 IBM] || Straight from IBM typewriter terminals with oblique letters. ||
[[File:APL2 Unicode.png|none]]
[[File:APL2 Unicode.png|none]]
|-
|[https://abrudz.github.io/APL2741/ APL2741 Unicode]||[https://github.com/abrudz/APL2741/raw/main/APL2741%20Unicode.ttf GitHub]||Unicode version of APL2741 with more characters.||
[[File:APL2741.png|none]]
|-
|-
|[http://apl385.com/fonts/index.htm APL385 Unicode]||[http://apl385.com/fonts/apl385.zip Adrian Smith]||Inspired by Comic Sans Serif.||
|[http://apl385.com/fonts/index.htm APL385 Unicode]||[http://apl385.com/fonts/apl385.zip Adrian Smith]||Inspired by Comic Sans Serif.||
Line 41: Line 44:
|-
|-
| [https://www.kreativekorp.com/software/fonts/fairfaxhd.shtml Fairfax HD] || [https://www.kreativekorp.com/swdownload/fonts/core/fairfaxhd.zip KreativeKorp] || Plotter-like font supporting many characters. || [[File:Fairfax HD.png|none]]
| [https://www.kreativekorp.com/software/fonts/fairfaxhd.shtml Fairfax HD] || [https://www.kreativekorp.com/swdownload/fonts/core/fairfaxhd.zip KreativeKorp] || Plotter-like font supporting many characters. || [[File:Fairfax HD.png|none]]
|-
| [https://github.com/Tortus-exe/FiraCode Fira Code APL] || [https://github.com/Tortus-exe/FiraCode/raw/master/FiraCodeAPL-Regular.otf Github] || A special version of the free monospaced font with programming ligatures which supports APL and BQN glyphs. ||
[[File:Fira_Code_APL_Unbolded.png|none|500px]]
|-
|-
| [https://github.com/rbanffy/3270font IBM 3270] || [https://github.com/rbanffy/3270font/releases/download/v2.2.1/3270_fonts_70de9c7.zip GitHub] || Modern version of a classic [[IBM]] terminal font. || [[File:IBM 3270.png|none|500px]]
| [https://github.com/rbanffy/3270font IBM 3270] || [https://github.com/rbanffy/3270font/releases/download/v2.2.1/3270_fonts_70de9c7.zip GitHub] || Modern version of a classic [[IBM]] terminal font. || [[File:IBM 3270.png|none|500px]]
Line 57: Line 63:
|-
|-
| [https://typeof.net/Iosevka/ Iosevka] Recursive Mono Style || [https://github.com/be5invis/Iosevka/releases/download/v10.1.1/ttf-iosevka-fixed-ss17-10.1.1.zip GitHub] || [[File:Iosevka Recursive Mono.png|none]]
| [https://typeof.net/Iosevka/ Iosevka] Recursive Mono Style || [https://github.com/be5invis/Iosevka/releases/download/v10.1.1/ttf-iosevka-fixed-ss17-10.1.1.zip GitHub] || [[File:Iosevka Recursive Mono.png|none]]
|-
| [https://www.jetbrains.com/mono/ JetBrains Mono] || [https://download.jetbrains.com/fonts/JetBrainsMono-2.304.zip JetBrains] || Geometric font optimized for reading vertically. || [[File:JetBrains_Mono.png]]
|-
|-
| [https://codeberg.org/Wezl/fonts poultreMono] || [https://codeberg.org/attachments/042040b4-ca97-4ffe-8401-540d4921e534 Codeberg] || A 5×9 pixel font. || [[File:PoultreMono.png|none]]
| [https://codeberg.org/Wezl/fonts poultreMono] || [https://codeberg.org/attachments/042040b4-ca97-4ffe-8401-540d4921e534 Codeberg] || A 5×9 pixel font. || [[File:PoultreMono.png|none]]
Line 103: Line 111:
== Historical anecdote ==
== Historical anecdote ==
Using [[IBM]]'s [[APL\360]] required the use of the [[wikipedia:IBM_2741#APL\360|IBM 2741]] or [[wikipedia:IBM 1050|IBM 1050]] printing terminal with an APL [[wikipedia:type ball|type ball]]. The APL2741 font is based directly on this type ball.
Using [[IBM]]'s [[APL\360]] required the use of the [[wikipedia:IBM_2741#APL\360|IBM 2741]] or [[wikipedia:IBM 1050|IBM 1050]] printing terminal with an APL [[wikipedia:type ball|type ball]]. The APL2741 font is based directly on this type ball.
== Rendering APL on websites ==
For APL code to be rendered well on a website, three conditions must be fulfilled:
# The page has to use a proper encoding
# The APL code has to be formatted with an appropriate APL font
# The APL font has to be made available for those users that do not have it installed
All these things can be achieved by inserting the following into the <syntaxhighlight lang=html inline><head></syntaxhighlight> element of the page.
Replace font name and file name with values corresponding to the desired font:
<syntaxhighlight lang=html>
<meta charset="UTF-8">
<style>
  @font-face {
    font-family: APL;
    src: local("APL385 Unicode"), url(Apl385.ttf)
  }
  pre, code {
    font-family: APL
  }
</style>
</syntaxhighlight>
The <syntaxhighlight lang=shell inline>Apl385.ttf</syntaxhighlight> font file must be placed in the same directory as the HTML file, and all APL code must be wrapped in <syntaxhighlight lang=html inline><pre></syntaxhighlight> or <syntaxhighlight lang=html inline><code></syntaxhighlight> elements.
== Bad rendering ==
The [[wikipedia:Blink browser engine]] instructs the [[wikipedia:HarfBuzz]] text shaping engine to prefer fidelity in typeface over fidelity in glyph shape. As a consequence, text using a font that lacks the <syntaxhighlight lang=apl inline>≢</syntaxhighlight> glyph ([[Tally]], [[Not Match]]) often ends up looking like <syntaxhighlight lang=apl inline>≡/</syntaxhighlight> (Match reduction), causing great confusion. The issue affects diverse things like Android WebView, Chromium Embedded Framework, all [[wikipedia:Electron (softwareframework)|Electron]] apps, [[wikipedia:Qt software)|Qt software)]], as well as many popular web browsers, like Amazon Silk, Google Chrome, Microsoft Edge, Brave, Opera, Vivaldi, and the Yandex Browser.
In browsers, it is possible to mitigate the problem by overriding the used font, for example using a user style manager, or by setting the browser to override fonts.
== Changing font in Dyalog RIDE ==
[[Dyalog Ltd]]'s cross-platform RIDE interface, which is the default GUI interface on all non-Windows platforms, does not expose a font setting. However, it is trivial to change font:
* Open ride-base.css[[#loc|*]]
* Find the line that says <syntaxhighlight lang=css inline>src: url('./fonts/Apl385.woff') format('woff'), url('./fonts/Apl385.ttf') format('truetype');</syntaxhighlight>
* Insert <syntaxhighlight lang=css inline>local('font name'),</syntaxhighlight> immediately after <syntaxhighlight lang=css inline>src:</syntaxhighlight>, for example <syntaxhighlight lang=css inline>src: local('SAX2'), url('./fonts/Apl385.woff') format('woff'), url('./fonts/Apl385.ttf') format('truetype');</syntaxhighlight>
* Restart RIDE
<span id=loc>[[#Changing font in Dyalog RIDE|*]]</span> The full path to ride-base.css varies (examples for RIDE 4.4 and Dyalog 18.2):
:* Stand-alone installation:
:** Windows: %LOCALAPPDATA%\Programs\Dyalog\Ride-4.4\resources\app\style\ride-base.css
:** Linux: /opt/ride-4.4/resources/app/style/ride-base.css
:** macOS: /Applications/Ride-4.4.app/resources/app/style/ride-base.css
:* Zero-footprint RIDE (served by the interpreter and normally accessed through a browser):
:** Linux or AIX: /opt/mdyalog/18.2/64/unicode/Contents/Resources/Dyalog/RIDEapp/resources/app/style/ride-base.css
:** macOS: /Applications/Dyalog-18.2.app/Contents/Resources/Dyalog/RIDEapp/resources/app/style/ride-base.css


== References ==
== References ==
<references/>
<references/>
{{APL development}}[[Category:APL character set]][[Category:Lists]]
{{APL development}}[[Category:APL character set]][[Category:Lists]]

Navigation menu