[NTG-context] Dotted characters

Hans Hagen pragma at wxs.nl
Tue Aug 16 09:54:26 CEST 2016


On 8/16/2016 9:43 AM, Taco Hoekwater wrote:
> Hi Lukáš,
>
>> On 16 Aug 2016, at 09:17, Procházka Lukáš Ing. <LPr at pontex.cz
>> <mailto:LPr at pontex.cz>> wrote:
>>
>> Hello,
>>
>> I'm preparing a child copybook.
>> I'd like to write a uppercased letter "as is" followed by its shape
>> drawn with dots - something like
>>
>>   /\       .
>>  /  \     . .
>> /____\   .....
>> /      \ .     .
>>
>> I guess that some MP "trick(s)" might be used;
>> also, a "simple" font should be used to be drawn dotted, which uses
>> "single drawings" to draw each line of the character.
>
> Most anything can be programmed, but in this case the task is very
> difficult.
>
> Modern fonts always use filled paths instead of stroke lines, so an “A”
> consists of two paths: the outer shape and the middle triange are separate:
>     _
>    / \
>   /   \          /\
>  /  _  \        /__\
> /_/   \_\
>
> there is no easy way to convert that into a dotted line that matches the
> ‘black parts’ of the glyph shape. Perhaps you could use two regular
> fonts: one sans-serif and one with dotted lines? There are some free
> fonts with dotted lines that can be found on the web, e.g.
> here: http://www.fontspace.com/category/dotted-line
>
> Another option would be draw the ‘normal’ uppercase letter directly as a
> metapost path. In that case it would be rather simple to create a
> generic dotted path from that using ‘setdash’. However, without manual
> work, it will not look as good as pre-drawn font, because for a ‘nice’
> dotted path you need to make sure that the dots in the crossbar of an
> ‘A’ line up nicely with the dots in the diagonal outer strokes, which is
> quite hard to do.

the best one can expect without too much work is

\startMPpage
     draw outlinetext.f
         ("A")
         () ;
     currentpicture := currentpicture shifted (-bbwidth currentpicture,0) ;
     draw outlinetext.d
         ("A")
         (withpen pencircle scaled 1/10
          dashed withdots scaled 1/20) ;
\stopMPpage

see attached

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp.pdf
Type: application/applefile
Size: 3782 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20160816/b0b65455/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp.tex
Type: application/x-tex
Size: 266 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20160816/b0b65455/attachment.tex>


More information about the ntg-context mailing list