Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-28 Thread jfbu
> 
> Three related issues were filed in the fontspec bug tracker, one of which
> has been closed:
> 
>   https://github.com/wspr/fontspec/issues/97
>   https://github.com/wspr/fontspec/issues/98
>   https://github.com/wspr/fontspec/issues/99
> 

Thanks,
Jean-François





--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread mskala
On Wed, 25 Jan 2017, jfbu wrote:
> in http://tug.org/pipermail/xetex/2011-February/020099.html
> (and also in one earlier post) in the thread pointed out by Ulrike,
> Matthew Skala commented on a WordSpace issue with fontspec.
>
> Has this issue been fixed since in fontspec ?

Three related issues were filed in the fontspec bug tracker, one of which
has been closed:

   https://github.com/wspr/fontspec/issues/97
   https://github.com/wspr/fontspec/issues/98
   https://github.com/wspr/fontspec/issues/99

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before principles.
http://ansuz.sooke.bc.ca/


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread jfbu
Hi


Le 25 janv. 2017 à 11:13, Zdenek Wagner  a écrit :

> It seems equally clear to me that the fault cannot lie in the fontspec 
> package,
> since it can be demonstrated with a pure XeTeX example as Jean-François
> has shewn ...  Whether the fault lies in the XeTeX engine or in the font is 
> moot,
> I believe.
> 
> It might be set in the font and XeTeX just reads it. I do not know how to 
> look inside the font but I heard somewhere, that such mono fonts do exist. 
> 


I know about lmvtt, for T1 encoding which is a "variable" variant of lmodern 
mono font
for traditional TeX engine, but this has to be requested by specific option,

also Michael Sharpe's newtxtt has such an option (and I use such a "variable 
space" 
mono font extensively in a package doc)

Perhaps Latin Modern Mono has it in the font, and luaotfload intercepts this so 
that
one does not see the phenomenon in the plain LuaTeX example,

Anyway, this will now break all XeLaTeX documents with verbatim parts, and 
default fonts, since the LaTeX 2017/01/01 recently uploaded to CTAN.

Arguably most XeLaTeX users will have set-up their own choice of fonts in
the document, thus the impact may not be that big "in the wild".

Best,

Jean-François



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread jfbu

Le 25 janv. 2017 à 10:50, Ulrike Fischer  a écrit :

>> 
> 
> There was once a long discussion about this xetex problem around
> here http://tug.org/pipermail/xetex/2011-February/020072.html

Hi, 

[somewhat peripheral question]

in http://tug.org/pipermail/xetex/2011-February/020099.html
(and also in one earlier post) in the thread pointed out by Ulrike,
Matthew Skala commented on a WordSpace issue with fontspec.

Has this issue been fixed since in fontspec ?

Jean-François




--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread Zdenek Wagner
2017-01-25 15:17 GMT+01:00 :

> On Wed, 25 Jan 2017, Philip Taylor wrote:
> > msk...@ansuz.sooke.bc.ca wrote:
> > > Using XeTeX without fontspec is a relatively unusual case
> > I respectfully disagree.  I use exclusively XeTeX and never fontspec.  I
> am certain that I am not alone in this.
>
> That's why I said "relatively unusual" and not "absolutely unheard of."
> Some people certainly do it.  Most people don't.
>

XeLaTeX + fontspec is usual, plain XeTeX users rarely use fonspec.

>
> --
> Matthew Skala
> msk...@ansuz.sooke.bc.ca People before principles.
> http://ansuz.sooke.bc.ca/
>
>

Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz



>
> --
> Subscriptions, Archive, and List information, etc.:
>   http://tug.org/mailman/listinfo/xetex
>


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread mskala
On Wed, 25 Jan 2017, Philip Taylor wrote:
> msk...@ansuz.sooke.bc.ca wrote:
> > Using XeTeX without fontspec is a relatively unusual case
> I respectfully disagree.  I use exclusively XeTeX and never fontspec.  I am 
> certain that I am not alone in this.

That's why I said "relatively unusual" and not "absolutely unheard of."
Some people certainly do it.  Most people don't.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before principles.
http://ansuz.sooke.bc.ca/


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread Philip Taylor
msk...@ansuz.sooke.bc.ca wrote:
> Using XeTeX without fontspec is a relatively unusual case 
I respectfully disagree.  I use exclusively XeTeX and never fontspec.  I am 
certain that I am not alone in this.
Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread David Carlisle
> Using XeTeX without fontspec is a relatively unusual case and it's
> unsurprising there hasn't been a lot of time spent on testing that.  The
> engine and package go together.

It may become slightly less unusual after this week's latex release as now
latex defaults to TU (Unicode) encoding with xetex and luatex
so the initial state for \ttfamiliy is OpenType latin modern monospace

However we will put out a patch level 1 release in the next day or so that
sets the font parameters 3 and 4 to zero in the fd file as in my
previous message
so the default setting of typewriter text will not stretch word spaces
in xelatex
just as in pdf and lua latex.

David


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread mskala
On Wed, 25 Jan 2017, Ulrike Fischer wrote:
> There was once a long discussion about this xetex problem around
> here http://tug.org/pipermail/xetex/2011-February/020072.html
> It is unclear if it is engine bug and imho no one ever added
> something to the issue tracker.

That was a long, complicated discussion touching on multiple issues:
between-sentence space, what actually is a monospace font, etc.  I
probably don't remember all the details clearly, and probably neither does
anyone else.  But I did skim through the archive just now and it does have
some useful information in it.  Worth reading the rest of the thread -
that particular posting isn't the last word on the issues it describes.

There is also an earlier thread in September 2010 about stretchability of
spaces in monospace setting, which may be relevant.

There were three items in the fontspec issue tracker and I think they've
all been long since dealt with.  But the goal in 2011 was for fontspec in
particular to correctly handle monospace spacing through size changes when
it had been told by the document that the font was monospace.  There
wasn't solid agreement on whether it's really a XeTeX bug that XeTeX
without fontspec initially sets those fontdimens nonzero.  Since fontspec
overrides them anyway, and that case wasn't important to the most vocal
complainers at the time (mostly myself), that particular point was never
explored further.

Using XeTeX without fontspec is a relatively unusual case and it's
unsurprising there hasn't been a lot of time spent on testing that.  The
engine and package go together.

The "monospace" flag in OpenType is unreliable.  It's probably not a good
idea to depend on its having a useful value.  Testing the comparative
widths of "i" and "m" is probably a better way to detect monospace fonts,
and as I understand it, that's what fontspec now does.  XeTeX itself could
do the same.

Even if the "monospace" flag in OpenType were reliably set according to
the OpenType specification (which we can't assume), it might not be
correct to use it. There is debate over correct interpretation of the
specification, but the consensus appears to be that the flag is supposed
to be set if and only if absolutely every glyph in the font with nonzero
width has the same width.  There are many fonts where more than one
distinct nonzero width exists, and so the flag ought to be turned off,
even though the fonts really are monospace in some important sense and
should be treated as such for purposes like sentence spacing.  For
instance, this is the usual case for CJK fonts, which are traditionally
set on a grid with CJK characters consuming a full square each and Western
characters consuming half a square each.  CJK fonts are especially
relevant to XeTeX.  Thus, we cannot trust the "monospace" flag in OpenType
to correctly tell XeTeX whether monospace-related adaptations like
unstretchable space, should be applied.

We cannot redefine the "monospace" flag to have a more useful value. Some
other software and maybe even hardware assumes that the OpenType
"monospace" flag is set if and only if absolutely every glyph in the font
with nonzero width has the same width.  These other systems will break if
their assumption is incorrect.  Thus even if we can edit font files to
have this flag set in a way that correctly tells XeTeX whether to apply
monospace-related adaptations, it would be a bad idea to use the flag
that way.

-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca People before principles.
http://ansuz.sooke.bc.ca/


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread Philip Taylor
Philip Taylor wrote:
> To answer my own question :  "yes" (assuming that "1" = "true") :
>
> 
>
> 
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
> 
>
In which case I feel that it might safely be argued that there is a deficiency 
in the XeTeX handling of Opentype monospaced fonts, unless (of course) the 
Opentype specification allows "isFixedPitch" (and perhaps analogous flags) to 
be ignored by a fully-compliant implementation.

** Phil.


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread Philip Taylor
Philip Taylor wrote:
>
> But do we know whether the font in question sets "isFixedPitch" true ?
>
To answer my own question :  "yes" (assuming that "1" = "true") :


































--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread Philip Taylor
Ulrike Fischer wrote:
>
> Actually I found an old discussion which seems to imply that xetex
> calculates the fontdimens starting from the width a space -- and
> doesn't care about monospace or not:
>
> https://tug.org/pipermail/xetex/2006-June/004236.html

But do we know whether the font in question sets "isFixedPitch" true ?
Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread David Carlisle
For latex at least I think the thing to do is amend tulmtt.fd in base
so that it has

\DeclareFontFamily{TU}{lmtt}{%
\hyphenchar \font\m@ne
\fontdimen3\font\z@%<<
\fontdimen4\font\z@%<<
}

with the two extra lines ensuring that these two font dimens are set to 0.

(If you try this with a latex 2017/01/01 release you need to remake
the format as it is input during format creation)

David


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread Ulrike Fischer
Am Wed, 25 Jan 2017 10:07:34 + schrieb Philip Taylor:

>  Whether the fault lies in the XeTeX engine or in the font is moot,

Well imho it is a difference if a font set this values and xetex
simply reads them in or if the font doesn't set this values and
xetex guesses (faulty) defaults. 

Actually I found an old discussion which seems to imply that xetex
calculates the fontdimens starting from the width a space -- and
doesn't care about monospace or not:

https://tug.org/pipermail/xetex/2006-June/004236.html


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



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread Zdenek Wagner
2017-01-25 11:07 GMT+01:00 Philip Taylor :

> Ulrike Fischer wrote:
> > There was once a long discussion about this xetex problem around
> > here http://tug.org/pipermail/xetex/2011-February/020072.html
> > It is unclear if it is engine bug and imho no one ever added
> > something to the issue tracker.
> Matthew concluded by writing :
>
> It seems clear to me that this is a bug, though I'm not sure yet whether
> it's better considered as a bug in the XeTeX engine or in the fontspec
> package, because it's not clear where the stretchability is being set.
>
> It seems equally clear to me that the fault cannot lie in the fontspec
> package,
> since it can be demonstrated with a pure XeTeX example as Jean-François
> has shewn ...  Whether the fault lies in the XeTeX engine or in the font
> is moot,
> I believe.
>

It might be set in the font and XeTeX just reads it. I do not know how to
look inside the font but I heard somewhere, that such mono fonts do exist.

>
> Philip Taylor
>
>
>
> Zdeněk Wagner
> http://ttsm.icpf.cas.cz/team/wagner.shtml
> http://icebearsoft.euweb.cz
>
>
> --
> Subscriptions, Archive, and List information, etc.:
>   http://tug.org/mailman/listinfo/xetex
>


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread Philip Taylor
Ulrike Fischer wrote:
> There was once a long discussion about this xetex problem around
> here http://tug.org/pipermail/xetex/2011-February/020072.html
> It is unclear if it is engine bug and imho no one ever added
> something to the issue tracker. 
Matthew concluded by writing :

It seems clear to me that this is a bug, though I'm not sure yet whether
it's better considered as a bug in the XeTeX engine or in the fontspec
package, because it's not clear where the stretchability is being set.

It seems equally clear to me that the fault cannot lie in the fontspec package,
since it can be demonstrated with a pure XeTeX example as Jean-François
has shewn ...  Whether the fault lies in the XeTeX engine or in the font is 
moot,
I believe.

Philip Taylor


--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-25 Thread Ulrike Fischer
Am Tue, 24 Jan 2017 19:20:21 +0100 schrieb jfbu:


> xetex: 5.25pt 2.625pt 1.75pt

There was once a long discussion about this xetex problem around
here http://tug.org/pipermail/xetex/2011-February/020072.html
It is unclear if it is engine bug and imho no one ever added
something to the issue tracker. 

But it is the reason why fontspec contains code that resets the
fontdimens if you use \setmonofont. It would be probably a good idea
if this code would be used for the new default mono font too.




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



--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex


Re: [XeTeX] why does Latin Modern Mono have some stretch and shrink with XeTeX ?

2017-01-24 Thread Will Robertson
Hi all,

I'm not able to check this minute, but I wonder if lmmono is being 
"special-cases" by luaotfload -- would explain the results you're seeing. 

In fontspec if you load it with \setmonofont the stretch and shrink should be 
forced to zero, but I can agree it would be good to get to the bottom of this. 

Cheers
Will
(Sent from phone; please excuse brevity.) 

> On 25 Jan. 2017, at 04:50, jfbu  wrote:
> 
> Hi,
> 
> test file
> 
> % Tested with TeXLive 2016, up-to-date.
> 
> % xetex
> \XeTeXtracingfonts=1
> \font\test="[lmmono10-regular.otf]"\test
> 
> % result otherwise with luatex:
> % (I don't know how to load font with luatex without luaotfload.sty)
> %\input luaotfload.sty
> %\font\test=[lmmono10-regular]:\test
> 
> \the\fontdimen2\font
> \quad
> \the\fontdimen3\font
> \quad
> \the\fontdimen4\font
> 
> \nopagenumbers
> \bye
> 
> xetex: 5.25pt 2.625pt 1.75pt
> 
> Requested font "[lmmono10-regular.otf]" scaled 1000
> -> /usr/local/texlive/2016/texmf-dist/fonts/opentype/public/lm/lmmono10-regula
> r.otf
> [1] )
> 
> luatex:5.25pt 0.0pt 0.0pt
> 
>  ve/2016/texmf-dist/fonts/opentype/public/lm/lmmono10-regular.otf>
> 
> % Local variables:
> % TeX-engine: xetex
> % End:
> 
> The stretch and shrink causes issues in code listings.
> 
> This impacts LaTeX now that Unicode engines
> use the Latin Modern fonts in opentype format by
> default with it.
> 
> LaTeX test file:
> 
> \documentclass{article}
> 
> \begin{document}
> \ttfamily
> 
> \the\fontdimen2\font
> \the\fontdimen3\font
> \the\fontdimen4\font
> 
> \fontname\font
> 
> \showoutput
> \thispagestyle{empty}
> \end{document}
> % Local variables:
> % TeX-engine: xetex
> % End:
> 
> xelatex: 5.25pt2.625pt1.75pt  "[lmmono10-regular]:"
> lualatex:5.25pt0.0pt0.0pt [lmmono10-regular]:
> 
> Best,
> 
> PS: as I don't currently subscribe to the list, could you please
> CC my address if replying thanks.
> 
> Jean-François
> 
> 
> ___
> Latex-team mailing list
> latex-t...@latex-project.org
> https://lists.dante.de/mailman/listinfo/latex-team




--
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex