[NTG-context] Dotted characters

Wolfgang Schuster schuster.wolfgang at gmail.com
Sat Aug 20 14:35:09 CEST 2016


> Lukáš Procházka <mailto:LPr at pontex.cz>
> 20. August 2016 um 14:03
> Hello again,
>
> the dotted font works perfectly.
>
> I'm using Lua to generate sheets from a database which contains 
> word-picture-picture2 records (see attached single page sample; I had 
> to convert the image to .jpg to reduce file size).
>
> One more question - is there a ConTeXt/Lua function which would assign 
> a non-diacritical-character to that with diacritics, like:
>
> Á => A
> Š => S
> Ý => Y etc.?
>
> I'm asking as the "Trace Font for Kids" doesn't contain characters 
> with diacritics...
>
> Simple Lua table would do the job, like
>
> ----
> remove_dia_czech =
> { ["é"] = "e",
>   ["š"] = "s",
>   ...
> }
> ----
>
> But string pattern in Lua with cp1250/UTF-8 might not be so easy as 
> Lua pattern "." matches single char (or - better - one byte - I 
> guess), so with UTF-8, chars with diacritics need more bytes; so the code
>
> ----
> str = ("Řetězec with diacritics"):gsub(".", remove_dia_czech)
> ----
>
> probably won't work.
>
> And Ctx Lua could have a mechanism already...
You can use the “characters.shaped” function which is described in 
cld-mkiv.pdf at page 87 and 119.

\starttext
Řetězec = \cldcontext{characters.shaped("Řetězec")}
\stoptext

Wolfgang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20160820/de6c65d3/attachment.html>


More information about the ntg-context mailing list