Re: [NTG-context] Notation of an arc

2018-09-26 Thread Alan Braslau
On Thu, 27 Sep 2018 09:22:00 +1200
Henri Menke  wrote:

> On 27/09/18 09:15, Fabrice Couvreur wrote:
> > Hello,
> > How to improve the notation of an arc ?
> > Thank you
> > Fabrice
> >   
> 
> Use the correct math fence
> 
> \starttext
> \m{\overparent{\rm AB}}
> \stoptext
> 
> > \starttext
> >  \m{\overset{\frown}{\rm AB}}
> > \stoptext

And, if you prefer, you can use MetaPost (rather than the font extensible):

\useMPlibrary[mat]
   
\definemathstackers
  [mp]
  [alternative=mp]

\definemathextensible [mp] [overparent] ["FE3DC]


Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Metafun: Finding intersection between characters

2018-09-26 Thread Jeong Dal
Dear Hans,2018. 9. 26. 오후 9:24, Hans Hagen  작성:On 9/26/2018 2:14 PM, Jeong Dal wrote:Dear Hans,I tested for more characters and found an interesting fact.If the first consonant and the vowels are connected in a glyph, then the outlining works OK, otherwise, it makes outline of the first consonant only.you need to send a file not embedded .. otherwise the mail agent will apply magic to koreanI didn’t think of it.I attached a sample file.Thank you for your concern.Best regards,Dalyoung

outlineKorean.tex
Description: TeX document
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Notation of an arc

2018-09-26 Thread Henri Menke
On 27/09/18 09:15, Fabrice Couvreur wrote:
> Hello,
> How to improve the notation of an arc ?
> Thank you
> Fabrice
> 

Use the correct math fence

\starttext
\m{\overparent{\rm AB}}
\stoptext

> \starttext
>  \m{\overset{\frown}{\rm AB}}
> \stoptext
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___
> 

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Notation of an arc

2018-09-26 Thread Fabrice Couvreur
Hello,
How to improve the notation of an arc ?
Thank you
Fabrice

\starttext
 \m{\overset{\frown}{\rm AB}}
\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] tounicode mapping missing for locl-variants

2018-09-26 Thread Ulrike Fischer

When I compile the following document I see in the output localized
variants for the various glyphs. But copy & paste works only for the
last line. The first two gives notdef chars. 

In the pdf e.g. the first glyph has the numbers 2D0E, 2D0F, 2D0D in
the three lines but only for the last there is a unicode mapping:
<2D0D> <5203>.

What can one do to get a mapping also for the other glyphs? 

The font can be downloaded here
https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/SourceHanSansJ.zip
A related bug report is
https://github.com/adobe-fonts/source-han-sans/issues/200


\pdfvariable compresslevel 0
\pdfvariable objcompresslevel 0
\setupheader[state=stop]
\starttext

\font\zhs=
{file:SourceHanSans-Regular.otf:mode=node;script=hani;language=ZHS;+locl}
\zhs 刃令毒骨縣誤

\font\zht=
{file:SourceHanSans-Regular.otf:mode=node;script=hani;language=ZHT;+locl}
\zht 刃令毒骨縣誤

\font\test=
{file:SourceHanSans-Regular.otf:mode=node;script=hani;language=DFLT;}
\test 刃令毒骨縣誤

\stoptext


-- 
Ulrike Fischer 
https://www.troubleshooting-tex.de/

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating flyers with ConTeXt

2018-09-26 Thread Jan U. Hasecke
On 26.09.18 12:56, Jan U. Hasecke wrote:
> On 26.09.18 09:03, Marco Patzer wrote:
> 
>> I looked into it and this is what I came up with:
>>
>> \definepageshift
>>   [flyer]
>>   [horizontal]
>>   [\dimexpr\measure{bleed}/2-\measure{shortfold}\relax,
>>\dimexpr\measure{bleed}/2\relax,
>>\dimexpr\measure{bleed}/2\relax,
>>\dimexpr\measure{bleed}/2+2\measured{shortfold}\relax,
>>\dimexpr\measure{bleed}/2\relax,
>>\dimexpr\measure{bleed}/2-\measure{shortfold}\relax]
> 
> I don't get the same values like before, when I calculate with these
> equations.
> 
> And while the aligns of the pages look good I get irregular bleeds.
> Especially the left edge bleed seems to be too small.
> 
> 
> I am so bad at math. :-(

After writing down all values I realized that I never questioned the
strange value 6.8. With 7 it is quite easy. ;-)


\definepageshift
[flyer]
[horizontal]
[\dimexpr\measure{bleed}-\measured{shortfold}\relax,
\measure{bleed},
\measure{bleed},
\dimexpr2\measured{shortfold}+\measured{bleed}\relax,
\measure{bleed},
\dimexpr\measure{bleed}-\measured{shortfold}\relax
]


Thanks a lot for your help.
juh


-- 
Soziale Plastik. Die Kunst der Allmende
Essay zum 30. Todestag von Joseph Beuys
http://www.amazon.de/dp/1523458763/
Taschenbuch, 130 Seiten, EUR 9,90
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] rscale with auto value

2018-09-26 Thread Aditya Mahajan

On Wed, 26 Sep 2018, Pablo Rodriguez wrote:


Wolfgang,

explaining the following sample to ConTeXt newbies, I have a problem:

   \setuppapersize[A5, landscape]
   \definefontfamily[mainface][rm][TeX Gyre Pagella]
   \definefontfamily[mainface][tt][DejaVu Sans Mono][rscale=0.825]
   \setupbodyfont[mainface, 22pt]
   \starttext
   \startmakeup[standard]
   This is available at {\tt https://contextarden.net}.
   \stopmakeup
   \stoptext

The problem is how to explain to someone who never used anything similar
to ConTeXt or TeX how she has to calculate the scale ratio. It is even
not simple to myself.

rscale is a useful option, but it would be great to have the auto value
that does all the math for the user.

Would it be possible that rscale could have the auto value?


See my answer to a similar question on TeX.SE

https://tex.stackexchange.com/a/450658/323

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] rscale with auto value

2018-09-26 Thread Pablo Rodriguez
Wolfgang,

explaining the following sample to ConTeXt newbies, I have a problem:

\setuppapersize[A5, landscape]
\definefontfamily[mainface][rm][TeX Gyre Pagella]
\definefontfamily[mainface][tt][DejaVu Sans Mono][rscale=0.825]
\setupbodyfont[mainface, 22pt]
\starttext
\startmakeup[standard]
This is available at {\tt https://contextarden.net}.
\stopmakeup
\stoptext

The problem is how to explain to someone who never used anything similar
to ConTeXt or TeX how she has to calculate the scale ratio. It is even
not simple to myself.

rscale is a useful option, but it would be great to have the auto value
that does all the math for the user.

Would it be possible that rscale could have the auto value?

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Metafun: Finding intersection between characters

2018-09-26 Thread Hans Hagen

On 9/26/2018 2:14 PM, Jeong Dal wrote:

Dear Hans,

I tested for more characters and found an interesting fact.
If the first consonant and the vowels are connected in a glyph, then the 
outlining works OK, otherwise, it makes outline of the first consonant only.


you need to send a file not embedded .. otherwise the mail agent will 
apply magic to korean




Here is a MWE.

Thank you.
Best regards,

Dalyoung

%
\definefontfeature
  [korean-base]
  [goodies=hanbatanglvt,
   colorscheme=default,
   mode=node,
   script=hang,
   language=kor]

\definefont[KoreanFont][hanbatanglvt*korean-base]

\starttext

\startMPdefinitions
string KoreanColors[] ;

KoreanColors[1] := "darkred" ;
KoreanColors[2] := "darkgreen" ;
KoreanColors[3] := "darkblue" ;
KoreanColors[4] := "darkyellow" ;
KoreanColors[5] := "darkgray" ;

def KoreanOutline(expr txt) =
picture p ; p := outlinetext.p(txt) ;
numeric n ; n := 0 ;
string old, new ; old := "" ;
for i within p :
new := prescriptpart i ;
if (new = "") or (new <> old) :
old := new ;
n := n + 1 ;
if unknown KoreanColors[n] :
n := 1 ;
fi ;
fi ;
draw pathpart i
withpen pencircle scaled 1/10
withcolor KoreanColors[n] ;
endfor ;
enddef ;
\stopMPdefinitions
% entered as three characters: ᄅ  ᅡ  ᆺ (mail collapses)
\startMPpage
KoreanOutline("\KoreanFont 랏") ;
\stopMPpage
\startMPpage
KoreanOutline("\KoreanFont 논") ;
\stopMPpage
\startMPpage
KoreanOutline("\KoreanFont 왕") ;
\stopMPpage
\startMPpage
KoreanOutline("\KoreanFont 닭") ;
\stopMPpage
\startMPpage
KoreanOutline("\KoreanFont 박") ;
\stopMPpage
\startMPpage
KoreanOutline("\KoreanFont 서") ;
\stopMPpage

%


2018. 9. 26. 오후 7:10, Hans Hagen  작성:

On 9/26/2018 1:48 AM, Jeong Dal wrote:

Dear Hans,
First, it is great to know a new method of drawing an outlined font!
  I have applied it to Korean fonts. As you know, every Korean character is 
composed with “consonant+vowel(+consonant)” type. If consonant and vowel are 
connected (for example, “호”), then it draws correctly, otherwise (for example, 
“하”)  it draws only consonant.
Is there a way to count all the paths in a character(even if it is not 
connected)?

I assume that you want to identify the upto 3 snippets in a glyph so what you 
can do is loop over a picture.

\definefontfeature
  [korean-base]
  [goodies=hanbatanglvt,
   colorscheme=default,
   mode=node,
   script=hang,
   language=kor]

\definefont[KoreanFont][hanbatanglvt*korean-base]

\starttext

\startMPpage
string KoreanColors[] ;

KoreanColors[1] := "darkred" ;
KoreanColors[2] := "darkgreen" ;
KoreanColors[3] := "darkblue" ;
KoreanColors[4] := "darkyellow" ;
KoreanColors[5] := "darkgray" ;

def KoreanOutline(expr txt) =
picture p ; p := outlinetext.p(txt) ;
numeric n ; n := 0 ;
string old, new ; old := "" ;
for i within p :
new := prescriptpart i ;
if (new = "") or (new <> old) :
old := new ;
n := n + 1 ;
if unknown KoreanColors[n] :
n := 1 ;
fi ;
fi ;
draw pathpart i
withpen pencircle scaled 1/10
withcolor KoreanColors[n] ;
endfor ;
enddef ;

% entered as three characters: ᄅ  ᅡ  ᆺ (mail collapses)

KoreanOutline("\KoreanFont 랏") ;
\stopMPpage

\stoptext

The prescript will be set in a next beta so then you get better results for 
more complex shapes.

Loading the font takes a bit of time and memory because the first time the 
outlines are filtered and converted and saved. But I assume Koreans TeX users 
have fast computers with lots of memory.

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-





--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : 

Re: [NTG-context] Metafun: Finding intersection between characters

2018-09-26 Thread Jeong Dal
Dear Hans,

I tested for more characters and found an interesting fact.
If the first consonant and the vowels are connected in a glyph, then the 
outlining works OK, otherwise, it makes outline of the first consonant only.

Here is a MWE.

Thank you.
Best regards,

Dalyoung

%
\definefontfeature
 [korean-base]
 [goodies=hanbatanglvt,
  colorscheme=default,
  mode=node,
  script=hang,
  language=kor]

\definefont[KoreanFont][hanbatanglvt*korean-base]

\starttext

\startMPdefinitions
   string KoreanColors[] ;

   KoreanColors[1] := "darkred" ;
   KoreanColors[2] := "darkgreen" ;
   KoreanColors[3] := "darkblue" ;
   KoreanColors[4] := "darkyellow" ;
   KoreanColors[5] := "darkgray" ;

   def KoreanOutline(expr txt) =
   picture p ; p := outlinetext.p(txt) ;
   numeric n ; n := 0 ;
   string old, new ; old := "" ;
   for i within p :
   new := prescriptpart i ;
   if (new = "") or (new <> old) :
   old := new ;
   n := n + 1 ;
   if unknown KoreanColors[n] :
   n := 1 ;
   fi ;
   fi ;
   draw pathpart i
   withpen pencircle scaled 1/10
   withcolor KoreanColors[n] ;
   endfor ;
   enddef ;
\stopMPdefinitions
   % entered as three characters: ᄅ  ᅡ  ᆺ (mail collapses)
\startMPpage
   KoreanOutline("\KoreanFont 랏") ;
\stopMPpage
\startMPpage
   KoreanOutline("\KoreanFont 논") ;
\stopMPpage
\startMPpage
   KoreanOutline("\KoreanFont 왕") ;
\stopMPpage
\startMPpage
   KoreanOutline("\KoreanFont 닭") ;
\stopMPpage
\startMPpage
   KoreanOutline("\KoreanFont 박") ;
\stopMPpage
\startMPpage
   KoreanOutline("\KoreanFont 서") ;
\stopMPpage

%

> 2018. 9. 26. 오후 7:10, Hans Hagen  작성:
> 
> On 9/26/2018 1:48 AM, Jeong Dal wrote:
>> Dear Hans,
>> First, it is great to know a new method of drawing an outlined font!
>>  I have applied it to Korean fonts. As you know, every Korean character is 
>> composed with “consonant+vowel(+consonant)” type. If consonant and vowel are 
>> connected (for example, “호”), then it draws correctly, otherwise (for 
>> example, “하”)  it draws only consonant.
>> Is there a way to count all the paths in a character(even if it is not 
>> connected)?
> I assume that you want to identify the upto 3 snippets in a glyph so what you 
> can do is loop over a picture.
> 
> \definefontfeature
>  [korean-base]
>  [goodies=hanbatanglvt,
>   colorscheme=default,
>   mode=node,
>   script=hang,
>   language=kor]
> 
> \definefont[KoreanFont][hanbatanglvt*korean-base]
> 
> \starttext
> 
> \startMPpage
>string KoreanColors[] ;
> 
>KoreanColors[1] := "darkred" ;
>KoreanColors[2] := "darkgreen" ;
>KoreanColors[3] := "darkblue" ;
>KoreanColors[4] := "darkyellow" ;
>KoreanColors[5] := "darkgray" ;
> 
>def KoreanOutline(expr txt) =
>picture p ; p := outlinetext.p(txt) ;
>numeric n ; n := 0 ;
>string old, new ; old := "" ;
>for i within p :
>new := prescriptpart i ;
>if (new = "") or (new <> old) :
>old := new ;
>n := n + 1 ;
>if unknown KoreanColors[n] :
>n := 1 ;
>fi ;
>fi ;
>draw pathpart i
>withpen pencircle scaled 1/10
>withcolor KoreanColors[n] ;
>endfor ;
>enddef ;
> 
>% entered as three characters: ᄅ  ᅡ  ᆺ (mail collapses)
> 
>KoreanOutline("\KoreanFont 랏") ;
> \stopMPpage
> 
> \stoptext
> 
> The prescript will be set in a next beta so then you get better results for 
> more complex shapes.
> 
> Loading the font takes a bit of time and memory because the first time the 
> outlines are filtered and converted and saved. But I assume Koreans TeX users 
> have fast computers with lots of memory.
> 
> Hans
> 
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Metafun: Finding intersection between characters

2018-09-26 Thread Jeong Dal
Dear Hans,

I have tested using your code. I just replace “N”, “T” with Korean letters.

Here is an MWE which is a simplified version of your code.
I tested using two fonts, and the outputs are different.

Thank you for your concern.

Best regards,

Dalyoung

%%%
\usetypescriptfile[type-hcrlvt]
\usetypescript[HcrFont] 
\setupbodyfont[Myface, rm, 12pt]
%\setupbodyfont[unfonts, rm, 12pt]

\startMPdefinitions
def filloutlinetext(expr o) =
draw image (
save n, m ; numeric n, m ; n := m := 0 ;
for i within o :
n := n + 1 ;
endfor ;
for i within o :
m := m + 1 ;
if n = m :
eofill
else :
nofill
fi pathpart i ;
endfor ;
)
enddef ;

def drawoutlinetext(expr o) =
draw image (
% nicer for properties
for i within o :
draw pathpart i ;
endfor ;
)
enddef ;

def outlinetexttopath(text o, p, n) =
scantokens("numeric " & str n &   ";") ;
scantokens("path "& str p & "[];") ;
n := 0 ;
for i within o : p[incr(n)] := pathpart i ; endfor ;
enddef ;

\stopMPdefinitions

\startbuffer[ho]
picture first  ; first  := outlinetext.p("호") ; first  := first scaled 
10 ;
filloutlinetext(first ) withcolor .5[blue,white] ;
drawoutlinetext(first ) ;
\stopbuffer
\startbuffer[ha]
picture first  ; first  := outlinetext.p("하") ; first  := first scaled 
10 ;
filloutlinetext(first ) withcolor .5[blue,white] ;
drawoutlinetext(first ) ;
\stopbuffer
\startbuffer[wang]
picture first  ; first  := outlinetext.p("왕") ; first  := first scaled 
10 ;
filloutlinetext(first ) withcolor .5[blue,white] ;
drawoutlinetext(first ) ;
\stopbuffer

\starttext

\processMPbuffer[ho]
\processMPbuffer[ha]
\processMPbuffer[wang]

\stoptext
%%%



type-hcrlvt.mkiv
Description: Binary data


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating flyers with ConTeXt

2018-09-26 Thread Jan U. Hasecke
On 26.09.18 09:03, Marco Patzer wrote:

> I looked into it and this is what I came up with:
> 
> \definepageshift
>   [flyer]
>   [horizontal]
>   [\dimexpr\measure{bleed}/2-\measure{shortfold}\relax,
>\dimexpr\measure{bleed}/2\relax,
>\dimexpr\measure{bleed}/2\relax,
>\dimexpr\measure{bleed}/2+2\measured{shortfold}\relax,
>\dimexpr\measure{bleed}/2\relax,
>\dimexpr\measure{bleed}/2-\measure{shortfold}\relax]

I don't get the same values like before, when I calculate with these
equations.

And while the aligns of the pages look good I get irregular bleeds.
Especially the left edge bleed seems to be too small.


I am so bad at math. :-(



juh
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Metafun: Finding intersection between characters

2018-09-26 Thread Hans Hagen

On 9/26/2018 1:48 AM, Jeong Dal wrote:

Dear Hans,

First, it is great to know a new method of drawing an outlined font!

  I have applied it to Korean fonts. As you know, every Korean character is 
composed with “consonant+vowel(+consonant)” type. If consonant and vowel are 
connected (for example, “호”), then it draws correctly, otherwise (for example, 
“하”)  it draws only consonant.
Is there a way to count all the paths in a character(even if it is not 
connected)?
I assume that you want to identify the upto 3 snippets in a glyph so 
what you can do is loop over a picture.


\definefontfeature
  [korean-base]
  [goodies=hanbatanglvt,
   colorscheme=default,
   mode=node,
   script=hang,
   language=kor]

\definefont[KoreanFont][hanbatanglvt*korean-base]

\starttext

\startMPpage
string KoreanColors[] ;

KoreanColors[1] := "darkred" ;
KoreanColors[2] := "darkgreen" ;
KoreanColors[3] := "darkblue" ;
KoreanColors[4] := "darkyellow" ;
KoreanColors[5] := "darkgray" ;

def KoreanOutline(expr txt) =
picture p ; p := outlinetext.p(txt) ;
numeric n ; n := 0 ;
string old, new ; old := "" ;
for i within p :
new := prescriptpart i ;
if (new = "") or (new <> old) :
old := new ;
n := n + 1 ;
if unknown KoreanColors[n] :
n := 1 ;
fi ;
fi ;
draw pathpart i
withpen pencircle scaled 1/10
withcolor KoreanColors[n] ;
endfor ;
enddef ;

% entered as three characters: ᄅ  ᅡ  ᆺ (mail collapses)

KoreanOutline("\KoreanFont 랏") ;
\stopMPpage

\stoptext

The prescript will be set in a next beta so then you get better results 
for more complex shapes.


Loading the font takes a bit of time and memory because the first time 
the outlines are filtered and converted and saved. But I assume Koreans 
TeX users have fast computers with lots of memory.


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Metafun: Finding intersection between characters

2018-09-26 Thread Hans Hagen

On 9/26/2018 1:48 AM, Jeong Dal wrote:

Dear Hans,

First, it is great to know a new method of drawing an outlined font!

  I have applied it to Korean fonts. As you know, every Korean character is 
composed with “consonant+vowel(+consonant)” type. If consonant and vowel are 
connected (for example, “호”), then it draws correctly, otherwise (for example, 
“하”)  it draws only consonant.
Is there a way to count all the paths in a character(even if it is not 
connected)?

mwe ...

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating flyers with ConTeXt

2018-09-26 Thread Marco Patzer
On Tue, 25 Sep 2018 12:57:54 +0200
"Jan U. Hasecke"  wrote:

> \definemeasure
>   [bleed]
>   [3mm]
> 
> I used this value to generalize the A4-flyer dimensions.
> 
> \definepapersize
>   [A4-flyer]
>   [width=\dimexpr297mm+2\measured{bleed}\relax,
>height=\dimexpr210mm+2\measured{bleed}\relax]

That looks good. Note that the value 297 needs to be changed if
“shortfold” is changed. Which is unlikely because it's based on an
A4 paper size. Still, keep that in mind.

> But horizontal pageshift is beyond my grasp.
> 
> I can't see how to generalize the values.

I looked into it and this is what I came up with:

\definepageshift
  [flyer]
  [horizontal]
  [\dimexpr\measure{bleed}/2-\measure{shortfold}\relax,
   \dimexpr\measure{bleed}/2\relax,
   \dimexpr\measure{bleed}/2\relax,
   \dimexpr\measure{bleed}/2+2\measured{shortfold}\relax,
   \dimexpr\measure{bleed}/2\relax,
   \dimexpr\measure{bleed}/2-\measure{shortfold}\relax]

Marco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___