Fonts: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
No edit summary
(Add Courier FZR APL)
 
(66 intermediate revisions by 10 users not shown)
Line 1: Line 1:
With the prevalence of [[Unicode]], many systems render APL legibly out-of-the-box. This article lists some fonts that are especially well-suited for rendering APL characters.
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, and shows how to use them.
== Monospace ==
{|class=wikitable
!Name<br>(website) !! Source<br>(download) !! Description !! Sample
|-
| [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]]
|-
|[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.||
[[File:APL385 Unicode.png|none]]
|-
|[https://abrudz.github.io/APL386/ APL386 Unicode]||[https://github.com/abrudz/APL386/raw/master/APL386.ttf GitHub]||APL385 Unicode with fewer issues and more accented characters.||
[[File:APL386 Unicode.png|none]]
|-
|[https://github.com/dzaima/BQN386 BQN386 Unicode]||[https://github.com/dzaima/BQN386/blob/master/BQN386.ttf?raw=true GitHub]||Re-hinted APL386 Unicode with harmonised glyphs and support for [[BQN]].||
[[File:APL386 Unicode.png|none]]
|-
| [http://www.microapl.com/apl/learn_apl.html APLX Upright] || [http://www.microapl.co.uk/download/aplx_unicode.ttf MicroAPL] || A monospaced grotesque font, reminiscent of Akzidenz-Grotesk.||
[[File:APLX Upright.png|none]]
|-
| [https://www.ibm.com/us-en/marketplace/apl2 Courier APL2 Unicode] || [https://www.ibm.com/account/reg/us-en/signup?formid=urx-32206 IBM] || The classic Courier typewriter font, extended with APL symbols.||
[[File:Courier APL2 Unicode.png|none]]
|-
| [https://github.com/ap29600/courier_fzr_apl Courier FZR APL] || [https://github.com/ap29600/courier_fzr_apl/raw/main/CourierFzrAPL-Regular.ttf GitHub] || An extension to the Courier Prime font featuring APL glyphs. || [[File:CourierFZR.png|none]]
|-
| [https://github.com/slavfox/Cozette Cozette] || [https://github.com/slavfox/Cozette/releases/download/v.1.20.0/CozetteVector.ttf GitHub] || A bitmap programming font optimized for coziness. (In Dyalog Windows IDE, works best in sizes divisble by 13) || [[File:Cozette.png|none]]
|-
|[https://mlochbaum.github.io/BQN/fonts.html DejaVu BQN Sans Mono]||[https://github.com/mlochbaum/BQN/blob/master/docs/DejaVuBQNSansMono.ttf?raw=true GitHub]||DejaVu Sans Mono with support for [[BQN]].||
[[File:DejaVu Sans Mono.png|none]]
|-
|[https://dejavu-fonts.github.io/ DejaVu Sans Mono]||[https://github.com/senotrusov/dejavu-fonts-ttf/raw/master/ttf/DejaVuSansMono.ttf GitHub]||Wide range of characters with original look and feel of Vera.||
[[File:DejaVu Sans Mono.png|none]]
|-
|[https://github.com/chrismwendt/bront DejaVu Sans Mono Bront]||[https://github.com/chrismwendt/bront/raw/master/DejaVuSansMono-Bront.ttf GitHub]|| DejaVu Sans Mono tweaked to be better geared for programming.||
[[File:DejaVu Sans Mono Bront.png|none]]
|-
|[https://www.nerdfonts.com/ DejaVu Sans Mono Nerd]||[https://raw.githubusercontent.com/ryanoasis/nerd-fonts/v2.0.0/patched-fonts/DejaVuSansMono/Regular/complete/DejaVu%20Sans%20Mono%20Nerd%20Font%20Complete%20Mono.ttf AUR]|| DejaVu Sans Mono patched with a high number of extra glyphs.||[[File:DejaVu Sans Mono.png|none]]
|-
| [https://www.evertype.com/emono/ Everson Mono] || [https://www.evertype.com/emono/evermono-beta.zip Evertype] (shareware) || A simple font, quite legible at sizes as small as 4 points. || [[File:Everson Mono.png|none]]
|-
| [https://www.kreativekorp.com/software/fonts/fairfax.shtml Fairfax] || rowspan=2|[https://www.kreativekorp.com/swdownload/fonts/relaybm/fairfax.zip KreativeKorp] || Regular/Bold/Italic 6×12 bitmap font supporting many characters. || [[File:Fairfax.png|none]]
|-
| [https://www.kreativekorp.com/software/fonts/fairfax.shtml Fairfax Serif] || Serif 6×12 bitmap font supporting many characters. || [[File:Fairfax_Serif.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://typeof.net/Iosevka/ Iosevka] Anonymous Pro Style || [https://github.com/be5invis/Iosevka/releases/download/v10.1.1/ttf-iosevka-fixed-ss02-10.1.1.zip GitHub]||rowspan=7|A slender, highly customisable monospace sans-serif and slab-serif typeface inspired by Pragmata Pro, M+ and PF DIN Mono. This list includes seven ready-made versions, but it is easy to build one's own version too. When compiling, it is possible to configure character variants with <code>apl-form = 'enable'</code> to prioritise harmonising APL glyphs. ||[[File:Iosevka Anonymous Pro.png|none]]
|-
| [https://typeof.net/Iosevka/ Iosevka] Fira Mono Style || [https://github.com/be5invis/Iosevka/releases/download/v10.1.1/ttf-iosevka-fixed-ss05-10.1.1.zip GitHub] || [[File:Iosevka Fira Mono.png|none]]
|-
| [https://typeof.net/Iosevka/ Iosevka] Pragmata Pro Style || [https://github.com/be5invis/Iosevka/releases/download/v10.1.1/ttf-iosevka-fixed-ss08-10.1.1.zip GitHub] || [[File:Iosevka Pragmata Pro.png|none]]
|-
| [https://typeof.net/Iosevka/ Iosevka] Source Code Pro Style || [https://github.com/be5invis/Iosevka/releases/download/v10.1.1/ttf-iosevka-fixed-ss09-10.1.1.zip GitHub] || [[File:Iosevka Source Code Pro.png|none]]
|-
| [https://typeof.net/Iosevka/ Iosevka] JetBrains Mono Style || [https://github.com/be5invis/Iosevka/releases/download/v10.1.1/ttf-iosevka-fixed-ss14-10.1.1.zip GitHub] || [[File:Iosevka JetBrains Mono.png|none]]
|-
| [https://typeof.net/Iosevka/ Iosevka] IBM Plex Mono Style || [https://github.com/be5invis/Iosevka/releases/download/v10.1.1/ttf-iosevka-fixed-ss15-10.1.1.zip GitHub] || [[File:Iosevka IBM Plex 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://www.fsd.it/shop/fonts/pragmatapro/ PragmataPro] || (commercial) || A condensed font optimized for coding, mathematics and engineering.||
[[File:PragmataPro.png|none]]
|-
| [https://abrudz.github.io/SAX2/ SAX2] || [https://github.com/abrudz/SAX2/raw/master/SAX2.ttf GitHub]||Curly font with italic letters, based on Sharp APL for Unix.||
[[File:SAX2.png|none]]
|-
|[http://archive.vector.org.uk/art10002160 SImPL] ||[http://archive.vector.org.uk/resource/simpl02.zip Vector]||Courier-based, but thicker.||
[[File:SImPL.png|none]]
|-
|[https://unifoundry.com/unifont/index.html Unifont] || [https://unifoundry.com/pub/unifont/unifont-13.0.06/font-builds/unifont-13.0.06.ttf Unifoundry] || Low-resolution bitmap fall-back font || [[File:Unifont.png|none]]
|}


== Proportional ==
{|class=wikitable
{|class=wikitable
!Name<br>(link to website) !! Direct download !! Features
!Name<br>(website) !! Source<br>(download) !! Description !! Sample
|-
|-
| [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.
|[http://apl385.com/fonts/index.htm APL333]|| [http://apl385.com/fonts/apl333.zip Adrian Smith] || Proportionally spaced version of APL385 Unicode||
[[File:APL333.png|none]]
|-
|-
|[http://apl385.com/fonts/index.htm APL333]|| [https://github.com/abrudz/aplcart/raw/master/apl333.ttf GitHub] ||Proportionally spaced version of APL385 Unicode
| [https://en.wikipedia.org/wiki/Code2000 Code2000] || [https://www.fontspace.com/code2000-font-f13284 FontSpace] || Wedge-serif pan-Unicode font. ||
[[File:Code2000.png|none]]
|-
|-
|[http://apl385.com/fonts/index.htm APL385 Unicode]||[http://www.dyalog.com/uploads/files/download.php?file=fonts_and_keyboards/Apl385.ttf Dyalog]||A fun, whimsical look, inspired by Comic Sans Serif.
| [https://typeof.net/Iosevka/ Iosevka Aile] || [https://github.com/be5invis/Iosevka/releases/download/v5.0.4/ttf-iosevka-aile-5.0.4.zip GitHub]|| Proportionally spaced version of Iosevka. ||
[[File:Iosevka Aile.png|none]]
|-
|-
|[https://github.com/abrudz/APL386 APL386 Unicode]||[https://github.com/abrudz/APL386/raw/master/APL386.ttf GitHub]||APL385 Unicode amended with additional accented Latin characters.
| [https://typeof.net/Iosevka/ Iosevka Etoile] || [https://github.com/be5invis/Iosevka/releases/download/v5.0.4/ttf-iosevka-fixed-ss02-5.0.4.zip GitHub]|| Proportionally spaced slab-serif version of Iosevka. ||
[[File:Iosevka Etoile.png|none]]
|-
|-
| [http://www.dyalog.com/aplx.htm APLX Upright] || [https://www.dyalog.com/uploads/aplx/aplx_unicode.ttf Dyalog] || A monospaced grotesque font, reminiscent of Akzidenz-Grotesk.
| [http://www.quivira-font.com/ Quivira] || [http://www.quivira-font.com/files/Quivira.otf Website] || Serif font supporting many symbols, similar to Garamond. ||
[[File:Quivira.png|none]]
|-
|-
| [https://www.ibm.com/us-en/marketplace/apl2 Courier APL2 Unicode] || [https://www.ibm.com/account/reg/us-en/signup?formid=urx-32206 IBM] || The classic Courier typewriter font, extended with APL symbols.
| [https://www.fonts.com/font/microsoft-corporation/segoe-ui-symbol Segoe UI Symbol] || (commercial) || Microsoft's humanist interface and corporate font. || [[File:Segoe UI Symbol.png|none]]
|-
|-
|[https://dejavu-fonts.github.io/ DejaVu Sans Mono]||[https://github.com/senotrusov/dejavu-fonts-ttf/raw/master/ttf/DejaVuSansMono.ttf GitHub]||Provides a wide range of characters while maintaining the original look and feel of the Vera Font.
|[https://www.stixfonts.org/ Stix Two Math]||[https://github.com/stipub/stixfonts/archive/v2.0.2.zip GitHub]|| Serif font, broadly compatible with Times New Roman.||
[[File:Stix Two Math.png|none]]
|-
|-
|[https://github.com/chrismwendt/bront DejaVu Sans Mono Bront]||[https://github.com/chrismwendt/bront/raw/master/DejaVuSansMono-Bront.ttf GitHub]|| DejaVu Sans Mono tweaked to be better geared for programming with Powerline symbols, low <source lang=apl inline>*</source>, long <source lang=apl inline>-</source>, more wavy <source lang=apl inline>~</source> in order to further differentiate it from <source lang=apl inline>-</source>, etc.
|[https://dn-works.com/ufas/ Symbola] || [https://dn-works.com/wp-content/uploads/2020/UFAS-Fonts/Symbola.zip UFAS] (free for personal non-commercial use only) || Supporting many scripts and symbols, similar to Computer Modern. || [[File:Screenshot 2021-03-19 Screenshot.png|none]]
|}
 
[[File:APLTypeBall.jpg|thumb|right|The APL typeball]]
 
== 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.
 
== 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|Blink browser engine]] instructs the [[wikipedia:HarfBuzz|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, either by configuring the browser to override all font specifications, or via a user style manager like [[wikipedia:Stylus (browser extension)|Stylus]] or [[wikipedia:Stylish|Stylish]], which gives more fine-grained control.  
 
Here are examples of appropriate user style rules for some common websites:
 
{|class=wikitable
! Domain !! Rule
|-
|-
|[https://www.nerdfonts.com/ DejaVu Sans Mono Nerd]||[https://raw.githubusercontent.com/ryanoasis/nerd-fonts/v2.0.0/patched-fonts/DejaVuSansMono/Regular/complete/DejaVu%20Sans%20Mono%20Nerd%20Font%20Complete%20Mono.ttf AUR]|| DejaVu Sans Mono patched with a high number of extra glyphs from popular ‘iconic fonts’ such as Font Awesome, Devicons, Octicons, and others.
| chat.stackexchange.com || <syntaxhighlight lang=css inline>div.message pre,div.message code{font-family:"APL385 Unicode"}</syntaxhighlight>
|-
|-
| [https://typeof.net/Iosevka/ Iosevka Envy Code R] || [https://github.com/be5invis/Iosevka/releases/download/v3.0.0-alpha.5/iosevka-term-ss10-3.0.0-alpha.5.zip GitHub]||rowspan=3|A slender monospace sans-serif and slab-serif typeface inspired by Pragmata Pro, M+ and PF DIN Mono, designed to be the ideal font for programming.
| stackexchange.com || <syntaxhighlight lang=css inline>.s-prose code,.comment-copy code{font-family:"APL385 Unicode"}</syntaxhighlight>
|-
|-
| [https://typeof.net/Iosevka/ Iosevka Pragmata Pro] || [https://github.com/be5invis/Iosevka/releases/download/v3.0.0-alpha.5/iosevka-term-ss08-3.0.0-alpha.5.zip GitHub]
| discord.com || <syntaxhighlight lang=css inline>code{font-family:"APL385 Unicode"!important}</syntaxhighlight>
|-
|-
| [https://typeof.net/Iosevka/ Iosevka Source Code Pro] || [https://github.com/be5invis/Iosevka/releases/download/v3.0.0-alpha.5/iosevka-term-ss09-3.0.0-alpha.5.zip GitHub]
| github.com || <syntaxhighlight lang=css inline>textarea,.cm-line,.blob-code-inner{font-family:"APL385 Unicode"}</syntaxhighlight>
|}
 
== Changing font in Dyalog RIDE ==
[[Dyalog Ltd]]'s cross-platform RIDE interface, which is the default GUI interface on all non-Windows platforms, did not expose a font setting until version 4.5. 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
 
==Designing a font==
Making a good APL font is no small task. Since many [[glyph]]s share sub-glyphs due to the history of [[overstrike|overstriking]], multiple dimensions of commonality need to be aligned. The following table can help:
{|class=wikitable
!Class !! Glyphs
|-
| alphas || <code>⍺⍶@</code>
|-
| arrows-down || <code>↓⍗⍖</code>
|-
| arrows-left || <code>←⍇⍅</code>
|-
| arrows-right || <code>→⍈⍆</code>
|-
| arrows-up || <code>↑⍐⍏</code>
|-
| asterisks || <code>*⍣⍟⋆</code>
|-
| brackets || <code>[]⌈⌊⌷</code>
|-
| circles || <code>○⍥⍟⌽⍉⊖⍜⊙⌾∅</code>
|-
| colons || <code>:⍠÷⌹</code>
|-
| commas || <code>,⍪;⍮</code>
|-
| dashes || <code>-+÷⌹⌿⍀⍪⍏⍖⊢⊣</code>
|-
| dels || <code>∇⍒⍫⍢</code>
|-
| deltas || <code>∆⍙⍋⍍</code>
|-
| diamonds || <code>⋄⌺⍚</code>
|-
| diereses || <code>¨⍨⍥⍤⍣⍢⍡⍩∵</code>
|-
| dots || <code>.:;?!⍰∵‼</code>
|-
| epsilons || <code>∊⍷</code>
|-
| equals || <code>=≠⌸⍯</code>
|-
| iotas || <code>⍳⍸</code>
|-
| jots || <code>∘⍤⍛⍝⍎⍕¤⌾⟃⟄</code>
|-
| letters || <code>⍺⍶∆⍙∂∊⍷⍳⍸λπ⍴ϼχ⍵⍹∫</code>
|-
|-
| [https://www.fsd.it/shop/fonts/pragmatapro/ PragmataPro] || (commercial) || A condensed font optimized for screen, designed to be the ideal font for coding, math and engineering.
| omegas || <code>⍵⍹</code>
|-
|-
| [https://github.com/abrudz/SAX2/ SAX2] || [https://github.com/abrudz/SAX2/raw/master/SAX2.ttf GitHub]||Based on the font from Sharp APL for Unix, with letters in italic, it has a very "curly" look.
| quads || <code>⎕⌸⌹⌺⌻⌼⍁⍂⍃⍄⍇⍈⍌⍍⍐⍓⍯⍰</code>
|-
|-
|[http://archive.vector.org.uk/art10002160 SImPL] ||[http://archive.vector.org.uk/resource/simpl02.zip Vector]||Courier-based with complete set of all known APL symbols, plus sufficient characters to allow prompts, comments, etc., to be expressed in every European language.
| quotes || <code>'!⍘⍞"‼</code>
|-
| shoes-down || <code>∪⍦</code>
|-
| shoes-left || <code>⊂⊆⍧⟃</code>
|-
| shoes-right || <code>⊃⊇⟄</code>
|-
| shoes-up || <code>∩⋔</code>
|-
| slashes || <code>/⌿⍁%⫽</code>
|-
| slashes-back || <code>\⍀⍉⍂⑊</code>
|-
| stiles || <code><nowiki>|</nowiki>⌽⍒⍋∥⍭⍦⍧$</code>
|-
| tacks-down || <code>⌶⊤⍕⍑⍡</code>
|-
| tacks-up || <code>⌶⊥⍎⍊</code>
|-
| tildes || <code>~⍬⍭⍱⍲</code>
|-
| underscores || <code>_⍙⍷⍛⍸⊆⊇⍊⍜⍶⍹⍮⍚⍘ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ</code>*
|-
| wedges-down || <code>∨⍱⍌</code>
|-
| wedges-left || <code><≤⍃ᑈ«</code>
|-
| wedges-right || <code>>≥⍄⍩ᐵ»</code>
|-
| wedges-up || <code>∧⍲⍓</code>
|-
| miscellaneous || <code>➥∞√˝⇐</code>
|}
|}
== External links ==
:<nowiki>*</nowiki> [[Dyalog APL]] maps the traditional APL underscored alphabet to [[Unicode]]'s circled uppercase letters.
* Phil Chastney: [http://www.chastney.com/~philip/SImPL/APL_fonts_are_different.pdf APL fonts are different]
 
{{APL development}}
== References ==
<references/>
{{APL development}}[[Category:APL character set]][[Category:Lists]]

Latest revision as of 07:04, 29 July 2024

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.[1] This article lists some fonts that are suited for APL, and shows how to use them.

Monospace

Name
(website)
Source
(download)
Description Sample
APL2 Unicode IBM Straight from IBM typewriter terminals with oblique letters.
APL2 Unicode.png
APL2741 Unicode GitHub Unicode version of APL2741 with more characters.
APL2741.png
APL385 Unicode Adrian Smith Inspired by Comic Sans Serif.
APL385 Unicode.png
APL386 Unicode GitHub APL385 Unicode with fewer issues and more accented characters.
APL386 Unicode.png
BQN386 Unicode GitHub Re-hinted APL386 Unicode with harmonised glyphs and support for BQN.
APL386 Unicode.png
APLX Upright MicroAPL A monospaced grotesque font, reminiscent of Akzidenz-Grotesk.
APLX Upright.png
Courier APL2 Unicode IBM The classic Courier typewriter font, extended with APL symbols.
Courier APL2 Unicode.png
Courier FZR APL GitHub An extension to the Courier Prime font featuring APL glyphs.
CourierFZR.png
Cozette GitHub A bitmap programming font optimized for coziness. (In Dyalog Windows IDE, works best in sizes divisble by 13)
Cozette.png
DejaVu BQN Sans Mono GitHub DejaVu Sans Mono with support for BQN.
DejaVu Sans Mono.png
DejaVu Sans Mono GitHub Wide range of characters with original look and feel of Vera.
DejaVu Sans Mono.png
DejaVu Sans Mono Bront GitHub DejaVu Sans Mono tweaked to be better geared for programming.
DejaVu Sans Mono Bront.png
DejaVu Sans Mono Nerd AUR DejaVu Sans Mono patched with a high number of extra glyphs.
DejaVu Sans Mono.png
Everson Mono Evertype (shareware) A simple font, quite legible at sizes as small as 4 points.
Everson Mono.png
Fairfax KreativeKorp Regular/Bold/Italic 6×12 bitmap font supporting many characters.
Fairfax.png
Fairfax Serif Serif 6×12 bitmap font supporting many characters.
Fairfax Serif.png
Fairfax HD KreativeKorp Plotter-like font supporting many characters.
Fairfax HD.png
Fira Code APL Github A special version of the free monospaced font with programming ligatures which supports APL and BQN glyphs.
Fira Code APL Unbolded.png
IBM 3270 GitHub Modern version of a classic IBM terminal font.
IBM 3270.png
Iosevka Anonymous Pro Style GitHub A slender, highly customisable monospace sans-serif and slab-serif typeface inspired by Pragmata Pro, M+ and PF DIN Mono. This list includes seven ready-made versions, but it is easy to build one's own version too. When compiling, it is possible to configure character variants with apl-form = 'enable' to prioritise harmonising APL glyphs.
Iosevka Anonymous Pro.png
Iosevka Fira Mono Style GitHub
Iosevka Fira Mono.png
Iosevka Pragmata Pro Style GitHub
Iosevka Pragmata Pro.png
Iosevka Source Code Pro Style GitHub
Iosevka Source Code Pro.png
Iosevka JetBrains Mono Style GitHub
Iosevka JetBrains Mono.png
Iosevka IBM Plex Mono Style GitHub
Iosevka IBM Plex Mono.png
Iosevka Recursive Mono Style GitHub
Iosevka Recursive Mono.png
JetBrains Mono JetBrains Geometric font optimized for reading vertically. JetBrains Mono.png
poultreMono Codeberg A 5×9 pixel font.
PoultreMono.png
PragmataPro (commercial) A condensed font optimized for coding, mathematics and engineering.
PragmataPro.png
SAX2 GitHub Curly font with italic letters, based on Sharp APL for Unix.
SAX2.png
SImPL Vector Courier-based, but thicker.
SImPL.png
Unifont Unifoundry Low-resolution bitmap fall-back font
Unifont.png

Proportional

Name
(website)
Source
(download)
Description Sample
APL333 Adrian Smith Proportionally spaced version of APL385 Unicode
APL333.png
Code2000 FontSpace Wedge-serif pan-Unicode font.
Code2000.png
Iosevka Aile GitHub Proportionally spaced version of Iosevka.
Iosevka Aile.png
Iosevka Etoile GitHub Proportionally spaced slab-serif version of Iosevka.
Iosevka Etoile.png
Quivira Website Serif font supporting many symbols, similar to Garamond.
Quivira.png
Segoe UI Symbol (commercial) Microsoft's humanist interface and corporate font.
Segoe UI Symbol.png
Stix Two Math GitHub Serif font, broadly compatible with Times New Roman.
Stix Two Math.png
Symbola UFAS (free for personal non-commercial use only) Supporting many scripts and symbols, similar to Computer Modern.
Screenshot 2021-03-19 Screenshot.png
The APL typeball

Historical anecdote

Using IBM's APL\360 required the use of the IBM 2741 or IBM 1050 printing terminal with an APL 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:

  1. The page has to use a proper encoding
  2. The APL code has to be formatted with an appropriate APL font
  3. 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 <head> element of the page. Replace font name and file name with values corresponding to the desired font:

<meta charset="UTF-8">
<style>
  @font-face {
    font-family: APL; 
    src: local("APL385 Unicode"), url(Apl385.ttf)
  }
  pre, code {
    font-family: APL
  }
</style>

The Apl385.ttf font file must be placed in the same directory as the HTML file, and all APL code must be wrapped in <pre> or <code> elements.

Bad rendering

The Blink browser engine instructs the HarfBuzz text shaping engine to prefer fidelity in typeface over fidelity in glyph shape. As a consequence, text using a font that lacks the glyph (Tally, Not Match) often ends up looking like ≡/ (Match reduction), causing great confusion. The issue affects diverse things like Android WebView, Chromium Embedded Framework, all Electron apps, 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, either by configuring the browser to override all font specifications, or via a user style manager like Stylus or Stylish, which gives more fine-grained control.

Here are examples of appropriate user style rules for some common websites:

Domain Rule
chat.stackexchange.com div.message pre,div.message code{font-family:"APL385 Unicode"}
stackexchange.com .s-prose code,.comment-copy code{font-family:"APL385 Unicode"}
discord.com code{font-family:"APL385 Unicode"!important}
github.com textarea,.cm-line,.blob-code-inner{font-family:"APL385 Unicode"}

Changing font in Dyalog RIDE

Dyalog Ltd's cross-platform RIDE interface, which is the default GUI interface on all non-Windows platforms, did not expose a font setting until version 4.5. However, it is trivial to change font:

  • Open ride-base.css*
  • Find the line that says src: url('./fonts/Apl385.woff') format('woff'), url('./fonts/Apl385.ttf') format('truetype');
  • Insert local('font name'), immediately after src:, for example src: local('SAX2'), url('./fonts/Apl385.woff') format('woff'), url('./fonts/Apl385.ttf') format('truetype');
  • Restart RIDE

* 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

Designing a font

Making a good APL font is no small task. Since many glyphs share sub-glyphs due to the history of overstriking, multiple dimensions of commonality need to be aligned. The following table can help:

Class Glyphs
alphas ⍺⍶@
arrows-down ↓⍗⍖
arrows-left ←⍇⍅
arrows-right →⍈⍆
arrows-up ↑⍐⍏
asterisks *⍣⍟⋆
brackets []⌈⌊⌷
circles ○⍥⍟⌽⍉⊖⍜⊙⌾∅
colons :⍠÷⌹
commas ,⍪;⍮
dashes -+÷⌹⌿⍀⍪⍏⍖⊢⊣
dels ∇⍒⍫⍢
deltas ∆⍙⍋⍍
diamonds ⋄⌺⍚
diereses ¨⍨⍥⍤⍣⍢⍡⍩∵
dots .:;?!⍰∵‼
epsilons ∊⍷
equals =≠⌸⍯
iotas ⍳⍸
jots ∘⍤⍛⍝⍎⍕¤⌾⟃⟄
letters ⍺⍶∆⍙∂∊⍷⍳⍸λπ⍴ϼχ⍵⍹∫
omegas ⍵⍹
quads ⎕⌸⌹⌺⌻⌼⍁⍂⍃⍄⍇⍈⍌⍍⍐⍓⍯⍰
quotes '!⍘⍞"‼
shoes-down ∪⍦
shoes-left ⊂⊆⍧⟃
shoes-right ⊃⊇⟄
shoes-up ∩⋔
slashes /⌿⍁%⫽
slashes-back \⍀⍉⍂⑊
stiles |⌽⍒⍋∥⍭⍦⍧$
tacks-down ⌶⊤⍕⍑⍡
tacks-up ⌶⊥⍎⍊
tildes ~⍬⍭⍱⍲
underscores _⍙⍷⍛⍸⊆⊇⍊⍜⍶⍹⍮⍚⍘ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ*
wedges-down ∨⍱⍌
wedges-left <≤⍃ᑈ«
wedges-right >≥⍄⍩ᐵ»
wedges-up ∧⍲⍓
miscellaneous ➥∞√˝⇐
* Dyalog APL maps the traditional APL underscored alphabet to Unicode's circled uppercase letters.

References

  1. Phil Chastney: APL fonts are different
APL development [edit]
Interface SessionTyping glyphs (on Linux) ∙ FontsText editors
Publications IntroductionsLearning resourcesSimple examplesAdvanced examplesMnemonicsISO 8485:1989ISO/IEC 13751:2001A Dictionary of APLCase studiesDocumentation suitesBooksPapersVideosAPL Quote QuadVector journalTerminology (Chinese, German) ∙ Neural networksError trapping with Dyalog APL (in forms)
Sharing code Backwards compatibilityAPLcartAPLTreeAPL-CationDfns workspaceTatinCider
Implementation ResourcesOpen-sourceMagic functionPerformanceAPL hardware
Developers Timeline of corporationsAPL2000DyalogIBMIPSASTSC