* Preview fonts from Dired with org-latex-preview (and test opentype features)
@ 2022-01-10 16:47 Juan Manuel Macías
0 siblings, 0 replies; only message in thread
From: Juan Manuel Macías @ 2022-01-10 16:47 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1339 bytes --]
I have written for my personal use this code (still quite crude) that
allows me to preview with org-latex-preview small text strings in a font
marked in dired, and test open type features too. The preview is
compiled with LuaLaTeX, since LuaTeX allows to load fonts that are not
installed in the system.
When a font is selected, the list of opentype features included in the
font are extracted (using the otfinfo command), and they are arranged in
the preview buffer as buttons. By clicking on each button we can
activate in the preview the corresponding opentype feature. For example,
if the font includes the 'smcp' feature, clicking on the button 'smcp'
the text will be displayed in small caps.
We can enter the text strings literally or through Unicode code: each
character separated by a space; the separation between words is marked
with a vertical bar. For example, this code:
0063 006f 0064 0065 | 0068 0065 0072 0065
returns the string "code here".
As a third option, a complete specimen can be displayed from a file.
Here is a demo video: https://cloud.disroot.org/s/aHXKiof36fTSZGB
As I said, my function is still pretty crude, and while it works well,
it's now more of a proof of concept than a finished thing. But if anyone
wants to try it, I attach the code here in an org document.
[-- Attachment #2: font-preview.org --]
[-- Type: application/vnd.lotus-organizer, Size: 10258 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-10 17:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 16:47 Preview fonts from Dired with org-latex-preview (and test opentype features) Juan Manuel Macías
Code repositories for project(s) associated with this inbox:
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).