Re: [XeTeX] Strange behaviour xelatex/fontspec/Windows

2011-10-01 Thread rhino64
WARNING: This e-mail has been altered by the NFIT virus/spamfilter.  Please see 
below for a record of the changes made.
. In case of problems consider contacting the sender or postmas...@nfit.au.dk

---Change report:

An attachment named SetTex.cmd was removed from this document as it
constituted a security hazard.  If you require this document, please contact
the sender and arrange an alternate means of receiving it.

Hi All,
Here is a slightly better solution that the one posted yesterday.
Instead of using an external program sed to modify the pattern file,
the perl distrubuted with texlive is used instead. 

Now there are only 3 small files:
   1) SetTex.cmd
   2) local.conf.pattern 
   3) subs.pl

The script SetTex.cmd can be installed where you wish. It
creates a local.font file with the correct letter for the drive,
redo the font cache and then call texworks and a command windows
with the environment variable PATH set with the path to all the TL2011
binaries plus the paths to few others useful binaries.

subs.pl a small perl script which substitute a specific
pattern with a disk letter in the model of the file
local.font. This files should be located in texmf-local/bin/win32

The file local.font.pattern is the local.fonts files
with specifics pattern for the disk letter. This file will be
modified with the perl script. It should be installed
in texmf-var/fonts/conf.

By modifying path in SetTex.cmd, it is possible to adapt the script
to other configuration.

best regards,

Alain

On Thu, Sep 29, 2011 at 09:31:06PM +0200, rhin...@postmail.ch wrote:
 Hi All,
  Thanks for all your advices. Finally, I was able to do what I want:
 to have TL2011 installed on an USB stick easily usable with XeLaTeX
 (the other engines do not seem to have problem with the font loading).
 
 This was surprisingly simple.
 
 In the attachement, you will find 4 files:
  1) sed.exe
  2) regex.dll
  3) local.conf.pattern
  4) SetTex.cmd
 
 The two first are simply the Unix sed command for Windows 
 directly downloaded from the GnuWin32 site. These files
 should be located in texmf-local/bin/win32.
 
 The file local.font.pattern is the local.fonts files
 with specifics pattern for the disk letter. This file will be
 modified with the sed command. It should be installed
 in texmf-var/fonts/conf.
 
 The script SetTex.cmd which can be installed where you wish. It
 create a local.font file with the correct letter for the drive,
 redo the font cache and then call texworks and a command windows
 with the environment variable PATH set with the path to all the TL2011
 binaries plus few others.
 
 By changing the paths inside SetTex.cmd, you can adapt the script to your
 configuration.
 
 best regards,
 
 Alain
 
?xml version=1.0?
!DOCTYPE fontconfig SYSTEM fonts.dtd
!-- /etc/fonts/fonts.conf file to configure system font access --
fontconfig
!-- Font directory list --
!-- On Windows, the texlive distribution is generally
 located in the directory /texlive followed
 by the year of the TL distribution.
 
 However, when the TeXlive is running from a removable device
 the letter of the disk can change. The pattern _DISQUE_
 should then be replaced by the correct drive letter and
 then the command fc-cache should be run to redefine
 the content of the cache.
--
dir_DISQUE_:/texlive/2011/texmf-dist/fonts/opentype/dir
dir_DISQUE_:/texlive/2011/texmf-dist/fonts/truetype/dir
dir_DISQUE_:/texlive/2011/texmf-dist/fonts/type1/dir
dir_DISQUE_:/texlive/2011/texmf-local/fonts/opentype/dir
dir_DISQUE_:/texlive/2011/texmf-local/fonts/truetype/dir
dir_DISQUE_:/texlive/2011/texmf-local/fonts/type1/dir
/fontconfig#!/usr/bin/perl
#
#This small perl program open a file, and substitute
#a pattern by a new string. The result is printed on STDOUT.
#
#The program has 3 arguments
#
#1) The file to modify
#2) The string to be replaced
#3) The replacement string

if ($#ARGV+1 !=  3){
  print Please give 3 arguments: FileName ToBeReplaced Replacement\n;
  exit(1);
}

my $file=$ARGV[0];
my $toBeReplaced=$ARGV[1];
my $replacement=$ARGV[2];
my $record;

open(FILE,$file) || die File '$file' cannot be open.;

while ($record = FILE){
   $record =~ s/$toBeReplaced/$replacement/g;
   print $record;
}

close(FILE);


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


Re: [XeTeX] Strange behaviour xelatex/fontspec/Windows

2011-09-28 Thread George N. White III
On Tue, Sep 27, 2011 at 3:10 AM,  rhin...@postmail.ch wrote:

 Sorry for the late answer. Your message was put in the wrong thread
 by my mail program.
 On Mon, Sep 26, 2011 at 05:53:38PM +0900, Akira Kakuto wrote:
  It seems that the fontconfig package is running on Windows.
  I have seen that the binaries (fc-list, fc-cache etc)
  of fontconfig package are present.

 (1)
 Please confirm that the fc-cache.exe is the one provided by
 TeX Live, that is, it is in the TeX Live binary directory .../bin/win32.
 The other fc-cache.exe cannot be used for XeTeX in TL W32.

 Yes it is the program given with TeXlive.
 (2)
 Go to the directory shown by the command
 kpsewhich -var-value FONTCONFIG_PATH

 (3)
 Make a file with the name local.conf in the directory, for example:

 ?xml version=1.0?
 !DOCTYPE fontconfig SYSTEM fonts.dtd
 !-- local.conf file to configure local font access --
 fontconfig
 !--
 Additional dirs for fontconfig. Subdirs are searched automatically.
 --

 dirg:/somedir/opentype/dir
 dirg:/somedir/truetype/dir

 /fontconfig
 It's the way I plan to follow. Creating a fonts.local
 with all the letters usable by Windows. Fortunately,
 only the letters C-Z are used by Windows.

 Then I will create a small batch file which will
 call fc-cache -v to redo the font cache. This is
 not particularly elegant but at least should work
 whenever the USB key is plugged on different Windows machine.

Why not have the batch file write a local.conf with the
correct drive letter?

 By the way, with the last version of XeTeX they seems
 to be a bug when handling fonts. I have a similar
 problem on OpenSolaris (XeTeX from TL 2011 crashes as soon as
 a specific font should be located on disk).

 With XeTeX from TeXLive 2010, they seems not to be
 the same problems.

 I should still debug more deeply the problem under
 OpenSolaris.

 (4)
 Run the commands
 mktexlsr
 fc-cache -v

You may be able to avoid the mktexlsr step, either by creating a
dummy local.conf and running mktexlsr once, then just updating
the local.conf file, or arranging to keep local.conf in a small tree
that doesn't use ls-R files.

 This seems to work when the fonts.conf is correct (during
 my first tests, the fonts.conf file does not contain the
 correct references to the fonts).

 What I should still check however is that if when the fonts.conf
 file is correct it is possible to load an non system font
 (the test which was successful, was when the desired
 font was considered as a system font since it was on the cache).

Loading TL supplied fonts without installing them as system fonts
certainly works for many users, but then you don't have then in
system tools, e.g., in font table viewers like BableMap.  A number
of ports of linux tools (Gimp, Inkscape) also use fontconfig and
supply their own config files, so you don't install fonts as system
fonts each app has a different list of available fonts.

 This test is now from less importance since I have found
 a bypass but it could reveal a bug in the font handling
 of XeTeX.

 I haven't had the time to do this last check. I will probably do it
 that for the end of week.


-- 
George N. White III aa...@chebucto.ns.ca
Head of St. Margarets Bay, Nova Scotia


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


Re: [XeTeX] Strange behaviour xelatex/fontspec/Windows

2011-09-27 Thread rhino64
Sorry for the late answer. Your message was put in the wrong thread
by my mail program.
On Mon, Sep 26, 2011 at 05:53:38PM +0900, Akira Kakuto wrote:
  It seems that the fontconfig package is running on Windows.
  I have seen that the binaries (fc-list, fc-cache etc) 
  of fontconfig package are present.
 
 (1)
 Please confirm that the fc-cache.exe is the one provided by
 TeX Live, that is, it is in the TeX Live binary directory .../bin/win32.
 The other fc-cache.exe cannot be used for XeTeX in TL W32.
 
Yes it is the program given with TeXlive.
 (2)
 Go to the directory shown by the command
 kpsewhich -var-value FONTCONFIG_PATH
 
 (3)
 Make a file with the name local.conf in the directory, for example:
 
 ?xml version=1.0?
 !DOCTYPE fontconfig SYSTEM fonts.dtd
 !-- local.conf file to configure local font access --
 fontconfig
 !-- 
 Additional dirs for fontconfig. Subdirs are searched automatically.
 --
 
 dirg:/somedir/opentype/dir
 dirg:/somedir/truetype/dir
 
 /fontconfig
It's the way I plan to follow. Creating a fonts.local
with all the letters usable by Windows. Fortunately,
only the letters C-Z are used by Windows.

Then I will create a small batch file which will
call fc-cache -v to redo the font cache. This is
not particularly elegant but at least should work
whenever the USB key is plugged on different Windows machine.

By the way, with the last version of XeTeX they seems
to be a bug when handling fonts. I have a similar
problem on OpenSolaris (XeTeX from TL 2011 crashes as soon as 
a specific font should be located on disk). 

With XeTeX from TeXLive 2010, they seems not to be
the same problems.

I should still debug more deeply the problem under
OpenSolaris.
 
 (4)
 Run the commands
 mktexlsr
 fc-cache -v

This seems to work when the fonts.conf is correct (during
my first tests, the fonts.conf file does not contain the
correct references to the fonts).

What I should still check however is that if when the fonts.conf
file is correct it is possible to load an non system font
(the test which was successful, was when the desired
font was considered as a system font since it was on the cache).
This test is now from less importance since I have found
a bypass but it could reveal a bug in the font handling
of XeTeX.

I haven't had the time to do this last check. I will probably do it
that for the end of week.


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


Re: [XeTeX] Strange behaviour xelatex/fontspec/Windows

2011-09-26 Thread Peter Dyballa

Am 25.09.2011 um 10:55 schrieb rhin...@postmail.ch:

 Yes I would prefer not to install GFS Didot in the font 
 directory of Windows and thus not to use the font service 
 for this font.

There are two or three possible options…

You could put the fonts into the same directory as the TeX file. This way you 
might not need to specify a relative path to the font file.

In case DOS really has no idea of relative paths, you could try to use the UNIX 
version, hoping that UNIX software like XeTeX or xdvipdfmx can understand it. 
. stands for right here, .. stands for one level above, / stands inside 
of a path for a path separator. ./some name.file means the file some 
name.file is here in this directory, ../../this directory/that 
directory/another directory/some name.file stands for a file that can be 
accessed in a directory three levels below a directory that is two levels above 
this one.

--
Greetings

  Pete

They that can give up essential liberty to obtain a little temporary safety 
deserve neither liberty nor safety.
-Benjamin Franklin, Historical Review of Pennsylvania




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


Re: [XeTeX] Strange behaviour xelatex/fontspec/Windows

2011-09-25 Thread Peter Dyballa

Am 24.09.2011 um 21:20 schrieb rhin...@postmail.ch:

   \fontspec[%
Extension=.otf,
UprightFont = *,
BoldFont=*Bold,
ItalicFont=*Italic,
BoldItalicFont=*BoldItalic]{GFSDidot}

With XeTeX you certainly don't need this block.

I could get your result only then when I remove GFS Didot from the font 
service, so I presume that you did not configure your font services to provide 
this font family.

XeTeX can load a font directly from the disk when you also describe the path to 
the font file. Otherwise it uses a font service. If some MS Windows (office) 
programme can use GFS Didot, then it's likely that it's in the font service and 
can be accessed by XeTeX and xdvipdfmx.

--
Greetings

  Pete

Let's face it; we don't want a free market economy either.
– James Farley, president, Coca-Cola Export Corp., 1959




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


Re: [XeTeX] Strange behaviour xelatex/fontspec/Windows

2011-09-25 Thread Peter Dyballa

Am 25.09.2011 um 10:55 schrieb rhin...@postmail.ch:

 Is this solution possible under Windows ? How to implement it ?

I prefer not to use MS Windows privately. (The setup for fontconfig is 
documented, some .CNF files already exist in the distribution.)

--
Greetings
 ]
  Pete   o__o |__o   recumbo
___o/I   -\, |o \  -\),-%   ergo sum!
___/\ /\___./ \___...O/ O.`-O-'-()--o_




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


Re: [XeTeX] Strange behaviour xelatex/fontspec/Windows

2011-09-25 Thread Ulrike Fischer
Am Sat, 24 Sep 2011 21:20:22 +0200 schrieb
rhin...@postmail.ch:

 Hi All,
 When using xelatex and fontspec (from updated TeXLive 2011)
 and specifying font by file name under Windows,
 The font cannot be loaded and a strange error message
 saying the name contains a blank is displayed.

 If the font is installed in the Windows font directory,
 the document can be typesetted.

You will have to track down the fontconfig configuration files. As
windows doesn't have a system wide fontconfig, TeXlive must (like
miktex) bring a fontconfig with it along with configuration files.
Miktex uses fonts.conf, localfonts.conf and localfonts2.conf - the
last can be used for user additions. 

Perhaps the documentation for unix can help you to find out how to
configure fontconfig for texlive on windows:

http://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-350003.4.4

 This problem does not arise with LuaLatex 

Luatex (luaotfload) use another method to find fonts.
-- 
Ulrike Fischer 



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


[XeTeX] Strange behaviour xelatex/fontspec/Windows

2011-09-24 Thread rhino64
Hi All,
  When using xelatex and fontspec (from updated TeXLive 2011)
and specifying font by file name under Windows,
The font cannot be loaded and a strange error message
saying the name contains a blank is displayed.
The error message displayed in DOS command windows is:
(c:/texlive/2011/texmf-dist/tex/latex/fontspec/fontspec.cfg))kpathsea: Invalid 
fontname `GFS Didot', contains ' '



!
! fontspec error: font-not-found
!
! The font GFS Didot cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H return.
!...

l.19\setmainfont{GFS Didot}

If the font is installed in the Windows font directory,
the document can be typesetted. 

This problem does not arise with LuaLatex and seems not
arise on other OS.

Any ideas ?

Thanks for the help,

-Example and logs---
\documentclass[12pt,draft]{article}

\usepackage{iftex}
\usepackage{fontspec}
   \ifXeTeX
  %Traitement des ligatures classiques de TeX
  \defaultfontfeatures{Mapping=tex-text}
   \else
  %LuaTeX a une manière différente de traiter les
  %ligatures classiques de TeX (i.e. --, --- etc).
  \defaultfontfeatures{Ligatures=TeX}
   \fi
   \fontspec[%
Extension=.otf,
UprightFont = *,
BoldFont=*Bold,
ItalicFont=*Italic,
BoldItalicFont=*BoldItalic]{GFSDidot}
   \setmainfont{GFS Didot}
\begin{document}
A Text in GFS Didot
\end{document}

---Log of the run terminated with error---
This is XeTeX, Version 3.1415926-2.3-0.9997.5 (Web2C 2011) (format=xelatex 
2011.9.10)  24 SEP 2011 20:17
entering extended mode
 restricted \write18 enabled.
 %-line parsing enabled.
**Example
(./Example.tex
LaTeX2e 2011/06/27
Babel v3.8m and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2011-07-01, ngerman-x-2011-07-01, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, galician, german, ngerman, swissgerman, monogreek, greek, hungarian,
 icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, marathi, or
iya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, kurmanji,
 lao, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, pol
ish, portuguese, romanian, russian, sanskrit, serbian, serbianc, slovak, sloven
ian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian, welsh, loaded
.
(c:/texlive/2011/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(c:/texlive/2011/texmf-dist/tex/latex/base/size12.clo
File: size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(c:/texlive/2011/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2010/07/25 v0.2 Provides if(tex) conditional for PDFTeX, XeTeX, 
and LuaTeX
)
(c:/texlive/2011/texmf-dist/tex/latex/fontspec/fontspec.sty
Package: fontspec 2011/02/26 v2.1f Advanced font selection for XeLaTeX/LuaLaTeX


(c:/texlive/2011/texmf-dist/tex/latex/l3kernel/expl3.sty
(c:/texlive/2011/texmf-dist/tex/latex/l3kernel/l3names.sty
(c:/texlive/2011/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty
Package: l3bootstrap 2011/08/29 v2687 L3 Experimental bootstrap code
)
Package: l3names 2011/08/10 v2538 L3 Experimental namespace for primitives
)
(c:/texlive/2011/texmf-dist/tex/latex/etex-pkg/etex.sty
Package: etex 1998/03/26 v2.0 eTeX basic definition package (PEB)
\et@xins=\count88
)
(c:/texlive/2011/texmf-dist/tex/latex/tools/calc.sty
Package: calc 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count89
\calc@Bcount=\count90
\calc@Adimen=\dimen103
\calc@Bdimen=\dimen104
\calc@Askip=\skip43
\calc@Bskip=\skip44
LaTeX Info: Redefining \setlength on input line 76.
LaTeX Info: Redefining \addtolength on input line 77.
\calc@Ccount=\count91
\calc@Cskip=\skip45
)
(c:/texlive/2011/texmf-dist/tex/latex/graphics/color.sty
Package: color 2005/11/14 v1.0j Standard LaTeX Color (DPC)

(c:/texlive/2011/texmf-dist/tex/latex/latexconfig/color.cfg
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package color Info: Driver file: xetex.def on input line 130.

(c:/texlive/2011/texmf-dist/tex/xelatex/xetex-def/xetex.def
File: xetex.def 2009/11/22 v0.94 LaTeX color/graphics driver for XeTeX (RRM/JK)

))
(c:/texlive/2011/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)

(c:/texlive/2011/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)

Re: [XeTeX] Strange behaviour xelatex/fontspec/Windows

2011-09-24 Thread Philip TAYLOR (Webmaster, Ret'd)
OK with TeX Live 2010.
Philip Taylor

rhin...@postmail.ch wrote:
 \documentclass[12pt,draft]{article}
 
 \usepackage{iftex}
 \usepackage{fontspec}
\ifXeTeX
   %Traitement des ligatures classiques de TeX
   \defaultfontfeatures{Mapping=tex-text}
\else
   %LuaTeX a une manière différente de traiter les
   %ligatures classiques de TeX (i.e. --, --- etc).
   \defaultfontfeatures{Ligatures=TeX}
\fi
\fontspec[%
 Extension=.otf,
 UprightFont = *,
 BoldFont=*Bold,
 ItalicFont=*Italic,
 BoldItalicFont=*BoldItalic]{GFSDidot}
\setmainfont{GFS Didot}
 \begin{document}
 A Text in GFS Didot
 \end{document}


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