Re: [XeTeX] Unexplained behavior

2011-01-16 Thread Paul Isambert

Le 15/01/2011 22:44, Bogdan Butnaru a écrit :

On Sat, Jan 15, 2011 at 20:01, Paul Isambert  wrote:

\thinspace is a \kern, which adapts to the mode it is in. What you want is
an horizontal space, but what happens is a vertical one, because the \kern
occurs in vertical mode (TeX is between paragraph at the time when \sepdash
occur, and between paragraph you're basically in vertical mode). You have to
begin the \sepdash macro with \leavevmode, so TeX switches to horinzontal
mode and typesets a horizontal space.

Oh, thanks for the explanation. It fixed that problem, but then I
noticed another one. I went through a few variations and I can’t get a
version that does what I want no matter what. Here’s what I’ve tried:

I want a typed em-dash to
1) in running text, be typeset with a small space around it
1a) ideally the space should be thin even if the source contains
spaces around it
1b) ideally the space should be glue rather than a kern, so it can
stretch a bit in stretched lines
2) line breaks should be forbidden before a dash, but should be allowed after
3) if a dash begins/ends a line, the space before/after it should disappear
4) and there should be no weird behavior otherwise...


1a) You unskip, very well.
1b) Allright, but an \hskip without plus/minus component doesn't stretch 
or shrink. (I've seen such a glue in your code.)
2) and 3) seems contradictory; if linebreak can't happen before a dash, 
how can it starts a line? You mean it starts a paragraph?

As for line ends, don't worry, space removal is ensured.

Your code wasn't minimal enough for me to try to make sense of it. I'll 
also try to honor point 5 in your next mail, but that is a hack; 
interchartoks would be better. Anyway here's a solution (untested):



\def\thedash{—}
\newskip\dashskip
\dashskip=.1em plus .1em % Or whatever else.

\def\mydash{%
  \unless\ifvmode
\unskip
\nobreak
\hskip\dashskip
  \fi
  \thedash
  \checkpunctuation
}

\makeatletter
\def\checkpunctuation{%
  
\@ifnextchar,{}{\@ifnextchar.{}{\@ifnextchar:{}{\@ifnextchar;{}{\hskip\dashskip%

% You should actually call with all the necessary characters.
}
\makeatother


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


Re: [XeTeX] strande behavior of Linux Libertine fonts with optio Fractions=On

2011-01-16 Thread mskala
On Thu, 13 Jan 2011, Fr. Michael Gilmary wrote:
> >   I couldn't find the source code for the OpenType features
> > in Latin Modern Roman;

> Voilà!
>
> > > > otfinfo -f lmroman10-regular.otf

I'd been hoping for the source code as such - i.e. the *.fea files.
Looking at the substitution tables after they're compiled into the *.otf
files can be difficult with a complicated feature like arbitrary-length
fractions; the table format isn't designed to be human-readable.

Nonetheless, I did take a look at the tables for Latin Modern Roman in
FontForge, and it appears to me that it's just substituting precomposed
glyphs - so that "one fraction two" will become "onehalf" and so on, but
it won't work on arbitrary fractions with a large number of digits.  I
haven't dug into Junicode myself, but Alexey Kryukov's posting suggests
that that's how Junicode does it as well.  The problem is in the
interaction between arbitrary-length fractions and digit sequences that
are not fractions:  I don't think it's possible to support
arbitrary-length fractions and also leave non-fraction digit sequences
untouched.
-- 
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] strande behavior of Linux Libertine fonts with optio Fractions=On

2011-01-16 Thread Khaled Hosny
On Sun, Jan 16, 2011 at 11:09:40AM -0600, msk...@ansuz.sooke.bc.ca wrote:
> On Thu, 13 Jan 2011, Fr. Michael Gilmary wrote:
> > >   I couldn't find the source code for the OpenType features
> > > in Latin Modern Roman;
> 
> > Voilà!
> >
> > > > > otfinfo -f lmroman10-regular.otf
> 
> I'd been hoping for the source code as such - i.e. the *.fea files.
> Looking at the substitution tables after they're compiled into the *.otf
> files can be difficult with a complicated feature like arbitrary-length
> fractions; the table format isn't designed to be human-readable.
> 
> Nonetheless, I did take a look at the tables for Latin Modern Roman in
> FontForge, and it appears to me that it's just substituting precomposed
> glyphs - so that "one fraction two" will become "onehalf" and so on, but
> it won't work on arbitrary fractions with a large number of digits.  I
> haven't dug into Junicode myself, but Alexey Kryukov's posting suggests
> that that's how Junicode does it as well.  The problem is in the
> interaction between arbitrary-length fractions and digit sequences that
> are not fractions:  I don't think it's possible to support
> arbitrary-length fractions and also leave non-fraction digit sequences
> untouched.

It can be done to some degree, see:
http://talleming.com/2009/10/01/fraction-fever-2/

(I didn't try it myself, though).

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer


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


Re: [XeTeX] strande behavior of Linux Libertine fonts with optio Fractions=On

2011-01-16 Thread mskala
On Sun, 16 Jan 2011, Khaled Hosny wrote:
> It can be done to some degree, see:
> http://talleming.com/2009/10/01/fraction-fever-2/

Looks like it's simply doing fixed-length sequences, with a large fixed
length.  That may be good enough in practice - who *really* needs to not
only typeset fractions with eleven-digit parts, but also do it
automatically?
-- 
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] strande behavior of Linux Libertine fonts with optio Fractions=On

2011-01-16 Thread Tobias Schoel
Why is it even necessary or wanted to typeset vulgar fractions of 
arbitrary length? Just using "1234/5678" seems to be adequate. That's 
the usual form in maths when the font size is so small, that 
\frac{1234}{5678} would be even smaller or disturbing if in the same size.


bye

Toscho

Am 16.01.2011 19:05, schrieb msk...@ansuz.sooke.bc.ca:

On Sun, 16 Jan 2011, Khaled Hosny wrote:

It can be done to some degree, see:
http://talleming.com/2009/10/01/fraction-fever-2/


Looks like it's simply doing fixed-length sequences, with a large fixed
length.  That may be good enough in practice - who *really* needs to not
only typeset fractions with eleven-digit parts, but also do it
automatically?



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


Re: [XeTeX] strande behavior of Linux Libertine fonts with optio Fractions=On

2011-01-16 Thread Philip Taylor (Webmaster, Ret'd)



Tobias Schoel wrote:


Why is it even necessary or wanted to typeset vulgar fractions of
arbitrary length? Just using "1234/5678" seems to be adequate. That's
the usual form in maths when the font size is so small, that
\frac{1234}{5678} would be even smaller or disturbing if in the same size.


Would it be possible to set continuing fractions using the slash notation ?
Philip Taylor


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


Re: [XeTeX] strande behavior of Linux Libertine fonts with optio Fractions=On

2011-01-16 Thread Alexey Kryukov
On Sun, 16 Jan 2011 11:09:40 -0600 (CST)
msk...@ansuz.sooke.bc.ca wrote:

> I'd been hoping for the source code as such - i.e. the *.fea files.
> Looking at the substitution tables after they're compiled into the
> *.otf files can be difficult with a complicated feature like
> arbitrary-length fractions; the table format isn't designed to be
> human-readable.

Note that OT layouts aren't always generated from Adobe's feature
files: *.fea is just one of possible human-readable formats. FontForge
and MS Volt don't use this format, but instead provide a visual
GUI for designing OT features, while Rogier van Dalen's OTComp
utility uses an alternate feature description format.

As for me, I like FontForge's GUI, but feel absolutely uncomfortable
with Adobe's files, so you won't find any *.fea "sources" for my own
fonts :) However FontForge allows to import/export Adobe's files, so
you could just use this feature and then study the imported file.

-- 
Regards,
Alexey Kryukov 

Moscow State University
Historical Faculty


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


Re: [XeTeX] strande behavior of Linux Libertine fonts with optio Fractions=On

2011-01-16 Thread Khaled Hosny
On Mon, Jan 17, 2011 at 12:04:33AM +0300, Alexey Kryukov wrote:
> On Sun, 16 Jan 2011 11:09:40 -0600 (CST)
> msk...@ansuz.sooke.bc.ca wrote:
> 
> > I'd been hoping for the source code as such - i.e. the *.fea files.
> > Looking at the substitution tables after they're compiled into the
> > *.otf files can be difficult with a complicated feature like
> > arbitrary-length fractions; the table format isn't designed to be
> > human-readable.
> 
> Note that OT layouts aren't always generated from Adobe's feature
> files: *.fea is just one of possible human-readable formats. FontForge
> and MS Volt don't use this format, but instead provide a visual
> GUI for designing OT features, while Rogier van Dalen's OTComp
> utility uses an alternate feature description format.

However, LM fonts were done using feature files a AFDKO, but they don't
usually publish the feature files (for whatever the reason), but IIRC
they offer them upon request.

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer


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