Fonts: Difference between revisions

Jump to navigation Jump to search
1,039 bytes added ,  16:30, 6 October 2022
how to use fonts on websites
m (Text replacement - "</source>" to "</syntaxhighlight>")
(how to use fonts on websites)
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 how to use them.
== Monospace ==
== Monospace ==
{|class=wikitable
{|class=wikitable
Line 103: Line 103:
== 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 (replace font name and file name with desired font):
# 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:
<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> file must then 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.


== Changing font in Dyalog RIDE ==
== Changing font in Dyalog RIDE ==

Navigation menu