Re: [NTG-context] Getting copy-pastable ligatures?

2014-12-04 Thread Gerben Wierda
On 30 Nov 2014, at 23:38, Hans Hagen pra...@wxs.nl wrote:

 On 11/30/2014 1:22 PM, Gerben Wierda wrote:
 I’m using mkii. I’d like ot be able to copy-paste words form the
 resulting pdf. That works well, except for words that contain ligatures
 (e.g. fl fi etc.) Is there a way I can tell (Con)TeXt that the result
 must be copy-pastable.
 
 To make matters slightly more complex I’m using Optima, converted on a Mac:
 
 \usetypescript[serif,sans,mono] [hanging] [normal]
 
 % Bypassing type-gtamacfonts.tex
 \starttypescript [sans,serif] [optima] [texnansi,ec]
 \definefontsynonym [Optima-Regular] [\typescriptthree-OptimaRegular]
 [encoding=\typescriptthree]
 \definefontsynonym [Optima-Italic] [\typescriptthree-OptimaItalic]
 [encoding=\typescriptthree]
 \definefontsynonym [Optima-Bold] [\typescriptthree-OptimaBold]
 [encoding=\typescriptthree]
 \definefontsynonym [Optima-BoldItalic] [\typescriptthree-OptimaBoldItalic]
 [encoding=\typescriptthree]
 \definefontsynonym [Optima-ExtraBlack] [\typescriptthree-OptimaExtraBlack]
 [encoding=\typescriptthree]
 \stoptypescript
 \starttypescript [sans,serif] [optima] [name]
 \setups  [font:fallback:\typescriptone]
 \definefontsynonym [\typescriptprefix\typescriptone] [Optima-Regular]
 \definefontsynonym [\typescriptprefix\typescriptone Italic] [Optima-Italic]
 \definefontsynonym [\typescriptprefix\typescriptone Bold][Optima-Bold]
 \definefontsynonym [\typescriptprefix\typescriptone BoldItalic]
 [Optima-BoldItalic]
 \definefontsynonym [\typescriptprefix\typescriptone Black]
 [Optima-ExtraBlack]
 \stoptypescript
 \definetypeface[allsans][rm][serif][optima][default][encoding=texnansi]
 \definetypeface[allsans][ss][sans][optima][default][encoding=texnansi]
 \loadmapfile [gtamacfonts.map]
 \setupbodyfont[allsans,10pt]
 
 op zich zou het moeten werken (een tonunicode vector) als er een pdfr-*.mkii 
 file is voor de encoding ... er is er eentje voor ec encoding

Ik ben er niet zo in thuis, maar welke items in bij font setup moet ik dan 
wijzigen?

G

 
 Hans
 
 
 -
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Getting copy-pastable ligatures?

2014-12-04 Thread Hans Hagen

On 12/4/2014 3:54 PM, Gerben Wierda wrote:

On 30 Nov 2014, at 23:38, Hans Hagen pra...@wxs.nl wrote:


On 11/30/2014 1:22 PM, Gerben Wierda wrote:

I’m using mkii. I’d like ot be able to copy-paste words form the
resulting pdf. That works well, except for words that contain ligatures
(e.g. fl fi etc.) Is there a way I can tell (Con)TeXt that the result
must be copy-pastable.

To make matters slightly more complex I’m using Optima, converted on a Mac:

\usetypescript[serif,sans,mono] [hanging] [normal]

% Bypassing type-gtamacfonts.tex
\starttypescript [sans,serif] [optima] [texnansi,ec]
\definefontsynonym [Optima-Regular] [\typescriptthree-OptimaRegular]
[encoding=\typescriptthree]
\definefontsynonym [Optima-Italic] [\typescriptthree-OptimaItalic]
[encoding=\typescriptthree]
\definefontsynonym [Optima-Bold] [\typescriptthree-OptimaBold]
[encoding=\typescriptthree]
\definefontsynonym [Optima-BoldItalic] [\typescriptthree-OptimaBoldItalic]
[encoding=\typescriptthree]
\definefontsynonym [Optima-ExtraBlack] [\typescriptthree-OptimaExtraBlack]
[encoding=\typescriptthree]
\stoptypescript
\starttypescript [sans,serif] [optima] [name]
\setups  [font:fallback:\typescriptone]
\definefontsynonym [\typescriptprefix\typescriptone] [Optima-Regular]
\definefontsynonym [\typescriptprefix\typescriptone Italic] [Optima-Italic]
\definefontsynonym [\typescriptprefix\typescriptone Bold][Optima-Bold]
\definefontsynonym [\typescriptprefix\typescriptone BoldItalic]
[Optima-BoldItalic]
\definefontsynonym [\typescriptprefix\typescriptone Black]
[Optima-ExtraBlack]
\stoptypescript
\definetypeface[allsans][rm][serif][optima][default][encoding=texnansi]
\definetypeface[allsans][ss][sans][optima][default][encoding=texnansi]
\loadmapfile [gtamacfonts.map]
\setupbodyfont[allsans,10pt]


op zich zou het moeten werken (een tonunicode vector) als er een pdfr-*.mkii 
file is voor de encoding ... er is er eentje voor ec encoding


Ik ben er niet zo in thuis, maar welke items in bij font setup moet ik dan 
wijzigen?


texnansi - ec

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] two issues with new hyphenator

2014-12-04 Thread Pablo Rodriguez
On 12/03/2014 08:30 PM, Hans Hagen wrote:
 
 no need to mess like that:

Many thanks for your reply, Hans.

Sorry, but the Lua code for the underscore hyphenation is all Greek to me.

I need the two following features: use the underscore character from the
font and enable it only for certain commands, not for the whole text.

Here is a minimal sample:

\showframe
\setupcolor[state=start]
\setuplayout[backspace=95mm, width=middle]
\definetype[TeXcode][option=TEX, compact=absolute]
\unexpanded\def\tex#1{\normalexpanded{\TeXcode{\letterbackslash#1}}}
\starttext
\tex{thisisaverylongcommand}
\hyphenatedurl{http://optimisticwayofthinking.optimist}
\input knuth
\stoptext

The text from Knuth needs to have the standard hyphenation character,
although the other two commands need to have underscore hyphenation.

Which is the best way to do it?

Many thanks for your help again,


Pablo



 \startluacode
 
  local function addfunnyhyphen(tfmdata)
  local exheight = tfmdata.parameters.xheight
  local emwidth  = tfmdata.parameters.quad
  local width= emwidth
  local height   = exheight / 10
  local depth= exheight / 2
  tfmdata.characters[0xFE000]   = {
  width= 0,
  height   = 0,
  depth= 0,
  commands = {
  { right, -width },
  { down, depth },
  { rule, height, width },
  }
  }
  end
 
  fonts.constructors.newfeatures(otf).register {
  name= funnyhyphen,
  description = funny hyphen,
  manipulators = {
  base = addfunnyhyphen,
  node = addfunnyhyphen,
  }
  }
 
 \stopluacode
 
 \definefontfeature[default][default][funnyhyphen=yes]
 
 \starttext
 
  \prehyphencharFE000
 
  \hsize 1mm
 
  averylongword
 
 \stoptext


-- 
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] White Space in Running Headers

2014-12-04 Thread Neal Lester
The following gets me close to what I am looking for.  Adding
\setupinterlinespace[1pt] seems to suppress the addition of space between
the lines of the header.  Changing the interlinespace only seems to have an
effect above some threshold related to the font size. For example, changing
1pt to 3pt has no visible effect. Changing 1pt to 10pt adds space between
the first and second lines only. Changing 1pt to 100pt adds space between
lines 1/2 and 2/3. I would prefer to have precise control over the space
between the lines, but I can live with this (it is much better than the
large spaces which appear of you remove the \setupinterlinespace
declarations).

This still leaves the problem of calculating the header height provided in
\setuplayout so that body text is a set distance from the header for
arbitrary font size, number of lines, and text contained in the header.

Thanks, Neal

\starttext
\setuppapersize[letter]
\setuplayout[topspace=0.20in,height=10.60in,header=28pt,footer=0.32in,headerdistance=0.03in,footerdistance=0.03in,backspace=0.3in,width=7.90in]
\setuppagenumbering [location=]
\define\headerframe{{\framed[frame=on,strut=no,offset=0.0pt,height=fit,width=7.9in,align=middle]{{\switchtobodyfont[24.00pt]\setupinterlinespace[1pt]
ee\par}
{\switchtobodyfont[10.00pt]\setupinterlinespace[1pt]
ee\par}
{\switchtobodyfont[24.00pt]\setupinterlinespace[1pt]
ee\par
\setupheadertexts[\headerframe][]
This is the body text.
\stoptext


On Wed, Dec 3, 2014 at 10:06 AM, Hans Hagen pra...@wxs.nl wrote:

 On 12/1/2014 9:57 PM, Neal Lester wrote:

 What is the best way to obtain precise control over the space between
 lines in a multi-line running header.  I need to be able to set the font
 size within each line by point size. Different lines may have different
 font sizes (indeed, there may be different font sizes within a single
 line).

 I've tried a number of approaches but always seem to end up with
 unexpected white space somewhere.


 if you want an answer you need to provide a minimal example showing the
 problem

 Hans


 -
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | 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://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] two issues with new hyphenator

2014-12-04 Thread Hans Hagen

On 12/4/2014 8:21 PM, Pablo Rodriguez wrote:

On 12/03/2014 08:30 PM, Hans Hagen wrote:


no need to mess like that:


Many thanks for your reply, Hans.

Sorry, but the Lua code for the underscore hyphenation is all Greek to me.

I need the two following features: use the underscore character from the
font and enable it only for certain commands, not for the whole text.

Here is a minimal sample:

\showframe
\setupcolor[state=start]
\setuplayout[backspace=95mm, width=middle]
\definetype[TeXcode][option=TEX, compact=absolute]
\unexpanded\def\tex#1{\normalexpanded{\TeXcode{\letterbackslash#1}}}
\starttext
\tex{thisisaverylongcommand}
\hyphenatedurl{http://optimisticwayofthinking.optimist}
\input knuth
\stoptext

The text from Knuth needs to have the standard hyphenation character,
although the other two commands need to have underscore hyphenation.

Which is the best way to do it?


it's no big deal to extend the mechanism to support this ...

\definetype
  [TeXcode]
  [option=TEX,
   compact=absolute,
   lines=hyphenated]

\definehyphenationfeatures
  [whatever]
  [righthyphenchar=_]

\setuphyphenation
  [method=traditional]

\unexpanded\def\TexC#1%
  {\dontleavehmode\begingroup
   \sethyphenationfeatures[whatever]%
   \normalexpanded{\TeXcode{\letterbackslash#1}}%
   \endgroup}

\starttext
\input tufte
\dorecurse{100}{\TexC{definebodyfont} }
\input tufte
\stoptext

i'll upload a beta (making one now)


Many thanks for your help again,


Pablo




\startluacode

  local function addfunnyhyphen(tfmdata)
  local exheight = tfmdata.parameters.xheight
  local emwidth  = tfmdata.parameters.quad
  local width= emwidth
  local height   = exheight / 10
  local depth= exheight / 2
  tfmdata.characters[0xFE000]   = {
  width= 0,
  height   = 0,
  depth= 0,
  commands = {
  { right, -width },
  { down, depth },
  { rule, height, width },
  }
  }
  end

  fonts.constructors.newfeatures(otf).register {
  name= funnyhyphen,
  description = funny hyphen,
  manipulators = {
  base = addfunnyhyphen,
  node = addfunnyhyphen,
  }
  }

\stopluacode

\definefontfeature[default][default][funnyhyphen=yes]

\starttext

  \prehyphencharFE000

  \hsize 1mm

  averylongword

\stoptext






--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___