Re: [NTG-context] SVG comments, transparency, and extended font styles

2021-04-03 Thread Hans Hagen

On 4/3/2021 9:46 PM, Thangalin wrote:

A bug report exists for the -inkscape-font-specification issue:

https://bugs.launchpad.net/inkscape/+bug/1324809 



I've migrated it, so hopefully it'll get some traction:

https://gitlab.com/inkscape/inbox/-/issues/4704 



It'd be nice to support that particular extension; however, the reason 
for not supporting it is sound. It sucks because end users don't care 
about such technical minutiae and can't readily unravel such font 
discrepancy issues when encountered.
maybe later as an add-on .. adding heuristics like that always are to be 
optional


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] SVG comments, transparency, and extended font styles

2021-04-03 Thread Thangalin
A bug report exists for the -inkscape-font-specification issue:

https://bugs.launchpad.net/inkscape/+bug/1324809

I've migrated it, so hopefully it'll get some traction:

https://gitlab.com/inkscape/inbox/-/issues/4704

It'd be nice to support that particular extension; however, the reason for
not supporting it is sound. It sucks because end users don't care about
such technical minutiae and can't readily unravel such font discrepancy
issues when encountered.
TX
___
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] Ligature suppression word list

2021-04-03 Thread Thangalin
Untested. Lists are not subject to copyright, so public domain should be
legal, even though SE posts are CC-BY-SA. When a word has a single suffix
or prefix (e.g., safflower/s), the two words are listed together, rather
than using an explicit suffix/prefix section.

return {
name   = "english",
version= "1.00",
comment= "English ligature suppression",
author = "Mico Loretan, Dave Jarvis, & Hans Hagen",
copyright  = "Public domain",
options= {
{
actions = {
["|"] = "noligature"
},
words = [[
]],
},
{
patterns = {
fi  = "f|i",
fl  = "f|l",
},
words = [[
-- f|i
deafish
dwarfish
elfish
oafish
selfish
serfish
unselfish
wolfish

-- f|l
beefless
briefless
hoofless
leafless
roofless
selfless
turfless
]],
suffixes = [[
ness
ly
]],
},
{
patterns = {
fi  = "f|i",
},
words = [[
proofing
]],
prefixes = [[
air-
child-
fire-
flame-
moth-
rust-
sound-
water-
weather-
]],
},
{
patterns = {
ff  = "f|f",
fi  = "f|i",
fl  = "f|l",
ffi = "f|fi",
ffl = "f|fl",
},
words = [[
-- f|f
bookshelfful
mantelshelfful
shelfful

-- f|i
elfin

chafing
leafing
loafing
sheafing
strafing
vouchsafing
beefing
reefing
briefing
debriefing
coifing
fifing
jackknifing
knifing
midwifing
waifing
wifing

goofing
hoofing
roofing
reroofing
spoofing
whoofing
woofing

gulfing
begulfing
engulfing
ingulfing
golfing
gulfing
rolfing
selfing
wolfing
barfing
bedwarfing
dwarfing
enserfing
kerfing
scarfing
snarfing
surfing
windsurfing
turfing
wharfing

beefier
comfier
goofier
gulfier
leafier
surfier
turfier
beefiest
comfiest
goofiest
gulfiest
leafiest
surfiest
turfiest

beefily
goofily
goofiness

-- f|l
aloofly
briefly
chiefly
deafly
liefly

calflike
dwarflike
elflike
gulflike
hooflike
leaflike
rooflike
serflike
sheaflike
shelflike
surflike
turflike
waiflike
wolflike

halflife
shelflife
halfline
roofline

leaflet
leaflets
leafleted
leafleting
leafletting
leafletted
leafleteer

pdflatex

-- f|fi
chaffinch
wolffish

-- f|fl
safflower
safflowers
]],
},
{
patterns = {
ffi = "ff|i",
},
words = [[
-- ff|i
cuffing
]],
prefixes = [[
hand
un
]],
},
{
patterns = {
ffi = "ff|i",
},
words = [[
-- ff|i
feoffing
]],
  

Re: [NTG-context] SVG comments, transparency, and extended font styles

2021-04-03 Thread Hans Hagen

On 4/3/2021 8:10 PM, Thangalin wrote:

Issues encountered with version 2021.03.31 18:04.

1. Comments in SVG

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg 
">


\stopbuffer

\starttext
   \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: Black circle, no border, comment lines ignored.
Actual: Empty square.

2. Transparent stroke

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg " 
version="1.1">



\stopbuffer

\starttext
   \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: Light cyan rectangle, no border (it's transparent).
Actual: Light cyan rectangle with visible border.


i'll check it .. if I forget, remind me.


3. Inkscape font specification

We discussed this previously: Inkscape extends the SVG specification 
with a custom style class ("-inkscape-font-specification") that allows 
its users to refine font styles.


% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg " 
viewBox="0 0 154.6 19.3" width="155" height="19">y="-2.3">style="-inkscape-font-specification:'Roboto, 
Ultra-Light';font-family:Roboto;font-size:20px;font-weight:200">Roboto 
Ultra-Light

\stopbuffer

\starttext
   \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: "Roboto Ultra-Light" appears in Roboto Ultra-Light font.
Actual: Empty square.

Supporting this via MetaPost would help maintain backwards compatibility 
(with ConTeXt invoking Inkscape).
Hm, one should export the 'simple' SVG from inkscape, not the bloated 
stuff. This is a bit like Adobe illustrator and its AI files: tons of 
crap needed for an editor but not really an 'eps' file for which there 
is a normal export. Once we decide to support all the weirdness there is 
no end. It's like the browser css madness.


Now, with regards to remapping fonts, doing that at the tex end should 
work ok (maybe some extra helper for svg to make it easier).


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
___


[NTG-context] SVG comments, transparency, and extended font styles

2021-04-03 Thread Thangalin
Issues encountered with version 2021.03.31 18:04.

1. Comments in SVG

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg;>

\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: Black circle, no border, comment lines ignored.
Actual: Empty square.

2. Transparent stroke

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg; version="1.1">


\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: Light cyan rectangle, no border (it's transparent).
Actual: Light cyan rectangle with visible border.

3. Inkscape font specification

We discussed this previously: Inkscape extends the SVG specification with a
custom style class ("-inkscape-font-specification") that allows its users
to refine font styles.

% SOF
\startbuffer[svg]
http://www.w3.org/2000/svg; viewBox="0 0 154.6 19.3"
width="155" height="19">Roboto
Ultra-Light
\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: "Roboto Ultra-Light" appears in Roboto Ultra-Light font.
Actual: Empty square.

Supporting this via MetaPost would help maintain backwards compatibility
(with ConTeXt invoking Inkscape).

Thank you!
___
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] Ligature suppression word list

2021-04-03 Thread Hans Hagen

On 4/3/2021 6:30 PM, Thangalin wrote:

A starting list of English non-ligatures:

https://english.stackexchange.com/a/50957/22099 



The entire SE thread has additional resources and is quite informative.

So can you make a file from that like we made as starting point for German?

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] Ligature suppression word list

2021-04-03 Thread Hans Hagen

On 4/3/2021 5:06 PM, denis.ma...@ub.unibe.ch wrote:





For those interested, that file only has ligature prevention definitions.

{
   actions = {
   ["|"] = "noligature"
   },
   words = [[
   Auf|lagefläche
   Auf|lageflächen
   Auf|lagenziffer
   Auf|lagenziffern
   ]],
},

can be (lig prevention already in words):

{
   words = [[
   Auf|lagefläche
   Auf|lageflächen
   Auf|lagenziffer
   Auf|lagenziffern
   ]],
},

or the more efficient (first match only):

{
   actions = {
   ["|"] = "noligature"
   },
   matches = { 1 }
   words = [[
   Auflagefläche
   Auflageflächen
   Auflagenziffer
   Auflagenziffern
   ]],
},

or if you want all matches:

{
   actions = {
   ["|"] = "noligature"
   },
   words = [[
   Auflagefläche
   Auflageflächen
   Auflagenziffer
   Auflagenziffern
   ]],
},

or when you want no kerns either (of course on can also use the petterns 
key):


   actions = {
   ["|"] = "noligature nokern"
   },
   words = [[
 ef|fe
   ]],
},

btw, user will also be able to do this in a document source

\startlanguageoptions[de]
Zapf|innovation
whatever+innovation
\stoplanguageoptions

ligature prevention in the first and compound word in the next one.

so, one way to see what we need is if users try to analyze their 
'exceptions' if they have them defined at all, so that we can spot 
possible tricks needed,


(i might actually combine this with exceptions that normally come after 
this stage)


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] Ligature suppression word list

2021-04-03 Thread Thangalin
A starting list of English non-ligatures:

https://english.stackexchange.com/a/50957/22099

The entire SE thread has additional resources and is quite informative.
___
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] Ligature suppression word list

2021-04-03 Thread Hans Hagen

On 4/3/2021 5:06 PM, denis.ma...@ub.unibe.ch wrote:


 1. The new language options features include a tracker that allows for
tracking for which words in a given document ligature prevention
happened, and which words haven’t been touched by the mechanism. It
should be possible to analyze the log file and to create lists of
words with ligatures. Should be a rather simple step to derive new
words for the ligature-suppression wordlist.
I already have some code for that but can't make you an update (garden 
is / will be down for some days due to maintenance).


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] Ligature suppression word list

2021-04-03 Thread Hans Hagen

On 4/3/2021 5:20 PM, Arthur Rosendahl wrote:

On Sat, Apr 03, 2021 at 03:06:22PM +, denis.ma...@ub.unibe.ch wrote:

What do you think?


   I think you should collaborate with the group of volunteers working on
German hyphenation and related topics.  They have a mailing list (in
German): https://lists.dante.de/mailman/listinfo/trennmuster which is
quite active and where Mico Loretan, the author of selnolig,
occasionally posts.  I’m sure they’ll be happy to help with suggestions
and collaborative efforts, even if all of the main contributors use
LaTeX.


german is just an example, dutch has some specific things, and i bet 
other languages have their demands so my aim is some general mechanism 
(for which much is already in place btw) ... we're talking of a what i 
tag as 'languages goodies' just like we have 'font goodies' .. a plug in 
system


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] Ligature suppression word list

2021-04-03 Thread Hans Hagen

On 4/3/2021 5:06 PM, denis.ma...@ub.unibe.ch wrote:

Hi everyone

Now that Hans has implemented the new ligature suppression mechanism via 
language goodies – thanks again Hans! – we now need to come up with 
wordlists.


I’ve started working on a list of German words with ligatures that 
should be suppressed. The list is derived from the word list that comes 
with the lualatex selnolig package: 
https://github.com/micoloretan/selnolig/blob/master/selnolig-german-wordlist.tex 



You can find the current list here : 
https://github.com/denismaier/context-nolig-wordlist 



The list is currently organized as follows :

 1. L.25-l.35: This specifies words where automatic pattern matching is
more difficult than usually because the words contain multiple
ligatures, some of which must be suppressed while others must be
preserved. In the case of « Auflagefläche » it’s even the same
combination of letters. So here, we use the bar | to manually
indicate points where no ligature must occur.
 2. L. 36ff.: The vast amount of words is currently in that list that
specifies words where a ff, fl, fi, ffi, or ffl ligature has to be
broken up after the first f.
 3. L.1804ff contain words where ffi, ffl, or fff ligatures have to be
prevented after the second f, so the first two fs form a ligature.
 4. The remaining blocks starting at L.1900, l. 2073, l. 2157, l. 2225,
and l. 2277 suppress ligatures for « ft » and « fft »,  « fb » and
« ffb », « fh » and « ffh», «fj» and «ffj», and «fk» and «ffk»

Obviously, that list is far from being complete, and the question is if 
it ever can be. Please have a look and feel free to propose more words 
to be included – either via mail or directly on github.


More generally, there’s the question how such a list should be enhanced? 
I was thinking about two options:


 1. The new language options features include a tracker that allows for
tracking for which words in a given document ligature prevention
happened, and which words haven’t been touched by the mechanism. It
should be possible to analyze the log file and to create lists of
words with ligatures. Should be a rather simple step to derive new
words for the ligature-suppression wordlist.
 2. A bigger solution might be to use selnoligs patterns in a script
that can be run over a large corpus, such as the DWDS (Digitales
Wörterbuch der deutschen Sprache). That should produce us a more
complete list of words where ligatures must be suppressed.


where is that DWDS ... i can write some code to deal with it (i'd rather 
start from the source than from some interpretation; who know what more 
there is to uncover)


additional info: we're talking of a mechanism sort of integrated in the 
hyphenation loop, where we can also handle compound words, if needed 
with details about how influence to hyphenate these) so the above 
question involves:


- exceptions to exceptions
- replacements before hyphenation
- compound words (including lhmin/rhmin overloads)
- (left right two sided) ligature and/or kern prevention

and whatever we like/need more (within reasonable bounds),

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] Ligature suppression word list

2021-04-03 Thread Arthur Rosendahl
On Sat, Apr 03, 2021 at 03:06:22PM +, denis.ma...@ub.unibe.ch wrote:
> What do you think?

  I think you should collaborate with the group of volunteers working on
German hyphenation and related topics.  They have a mailing list (in
German): https://lists.dante.de/mailman/listinfo/trennmuster which is
quite active and where Mico Loretan, the author of selnolig,
occasionally posts.  I’m sure they’ll be happy to help with suggestions
and collaborative efforts, even if all of the main contributors use
LaTeX.

Arthur
___
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] Ligature suppression word list

2021-04-03 Thread denis.maier
Hi everyone

Now that Hans has implemented the new ligature suppression mechanism via 
language goodies - thanks again Hans! - we now need to come up with wordlists.

I've started working on a list of German words with ligatures that should be 
suppressed. The list is derived from the word list that comes with the lualatex 
selnolig package: 
https://github.com/micoloretan/selnolig/blob/master/selnolig-german-wordlist.tex

You can find the current list here : 
https://github.com/denismaier/context-nolig-wordlist

The list is currently organized as follows :


  1.  L.25-l.35: This specifies words where automatic pattern matching is more 
difficult than usually because the words contain multiple ligatures, some of 
which must be suppressed while others must be preserved. In the case of « 
Auflagefläche » it's even the same combination of letters. So here, we use the 
bar | to manually indicate points where no ligature must occur.
  2.  L. 36ff.: The vast amount of words is currently in that list that 
specifies words where a ff, fl, fi, ffi, or ffl ligature has to be broken up 
after the first f.
  3.  L.1804ff contain words where ffi, ffl, or fff ligatures have to be 
prevented after the second f, so the first two fs form a ligature.
  4.  The remaining blocks starting at L.1900, l. 2073, l. 2157, l. 2225, and 
l. 2277 suppress ligatures for « ft » and « fft »,  « fb » and « ffb », « fh » 
and « ffh», «fj» and «ffj», and «fk» and «ffk»

Obviously, that list is far from being complete, and the question is if it ever 
can be. Please have a look and feel free to propose more words to be included - 
either via mail or directly on github.

More generally, there's the question how such a list should be enhanced? I was 
thinking about two options:

  1.  The new language options features include a tracker that allows for 
tracking for which words in a given document ligature prevention happened, and 
which words haven't been touched by the mechanism. It should be possible to 
analyze the log file and to create lists of words with ligatures. Should be a 
rather simple step to derive new words for the ligature-suppression wordlist.
  2.  A bigger solution might be to use selnoligs patterns in a script that can 
be run over a large corpus, such as the DWDS (Digitales Wörterbuch der 
deutschen Sprache). That should produce us a more complete list of words where 
ligatures must be suppressed.

What do you think?

Best,
Denis
___
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
___