From a56f8ba40eca9bd44ddf2b7d60e6ebcaf9e56378 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 21 Jan 2009 01:33:46 +0000 Subject: accfonts 0.24 (20jan09) git-svn-id: svn://tug.org/texlive/trunk@11936 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/fonts/accfonts/CHANGES | 30 +++++- Master/texmf-dist/doc/fonts/accfonts/README | 148 +++++++++++++------------- Master/texmf-dist/doc/fonts/accfonts/mkt1font | 88 +++++++++------ Master/texmf-dist/doc/fonts/accfonts/vpl2ovp | 109 +++++++++++-------- Master/texmf-dist/doc/fonts/accfonts/vpl2vpl | 31 +++--- 5 files changed, 235 insertions(+), 171 deletions(-) (limited to 'Master/texmf-dist/doc/fonts') diff --git a/Master/texmf-dist/doc/fonts/accfonts/CHANGES b/Master/texmf-dist/doc/fonts/accfonts/CHANGES index 01af0961fc6..92a5b8312f9 100644 --- a/Master/texmf-dist/doc/fonts/accfonts/CHANGES +++ b/Master/texmf-dist/doc/fonts/accfonts/CHANGES @@ -253,8 +253,8 @@ A. Changes to mkt1font Changed FamilyName to remove only the final one of a number of hyphenated elements from the font name. -Changes tbetween release 0.222 and release 0.23 -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Changes between release 0.222 and release 0.23 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A. Changes to mkt1font ~~~~~~~~~~~~~~~~~~~~~~ @@ -298,3 +298,29 @@ U+0304 + U+0301 ("a" + macron + acute). This is a considerable advantage, given the different possible ways in which Unicode can be, and is, used. +Changes between release 0.23 and release 0.24 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +A. Changes to mkt1font +~~~~~~~~~~~~~~~~~~~~~~ + +The format expected of glyph names has been brought into line with +Adobe's specification, i.e. they may contain upper- and lower-case +letters, numerals, "_" and ".", but must begin with a letter or with +"_". The format expected of PFB head and tail material has been made +less restrictive, to match the realities of perceived usage. A bug in +digraph creation has been fixed. A "dotlessj" character is created for +use with superscript accents. Full Flex hinting is now supported. + +B. Changes to vpl2vpl +~~~~~~~~~~~~~~~~~~~~~ + +The help information has been improved. + +C. Changes to vpl2ovp +~~~~~~~~~~~~~~~~~~~~~ + +A bug has been fixed that generated "ghost" replicas of some existing +accent characters in the Private Use Area. The handling of digraphs +and underscored digraphs has been brought into better Unicode +compliance. The help information has also been improved. diff --git a/Master/texmf-dist/doc/fonts/accfonts/README b/Master/texmf-dist/doc/fonts/accfonts/README index 7f775f1b858..79431d76537 100644 --- a/Master/texmf-dist/doc/fonts/accfonts/README +++ b/Master/texmf-dist/doc/fonts/accfonts/README @@ -133,28 +133,28 @@ on the command line, as follows: -n should name the font it is intended to generate. Avoid names such as "myfont", as both mkt1font and other programs attempt to draw conclusions from the name; better would be something - like "Utopia_French-BoldItalic". The generated font files will - also use this for their basename. + like "Utopia_French-BoldItalic". The generated font files + will also use this for their basename. -d should refer to a font definition file. This file (which could - usefully be named, e.g., "French.def") should consist of lines - of character definitions, in the form + usefully be named, e.g., "French.def") should consist of + lines of character definitions, in the form "number" "character" or "number" "character" "accent" Here "number" represents the character's position in the new encoding and may be expressed in decimal, octal or hex; - "character" names the character (e.g. "comma", "eight", "A") - or consists of the word ".notdef" (indicating that the - specified number's "slot" in the new encoding is to be empty); - and "accent" optionally names an accent to be placed on the - character. In addition to the standard accents available in - PostScript fonts, "underbar" and "underdot" are also available, - as are "under" versions of all the normal superscript accents - ("underdieresis", "underring", etc.). The Indian accent - "candrabindu" may also be specified: it is formed by - overprinting a breve with a dotaccent. Finally, "overdot" may - be used as a synonym for "dotaccent". + "character" names the character (e.g. "comma", "eight", + "A") or consists of the word ".notdef" (indicating that + the specified number's "slot" in the new encoding is to be + empty); and "accent" optionally names an accent to be placed + on the character. In addition to the standard accents available + in PostScript fonts, "underbar" and "underdot" are also + available, as are "under" versions of all the normal + superscript accents ("underdieresis", "underring", etc.). + The Indian accent "candrabindu" may also be specified: it + is formed by overprinting a breve with a dotaccent. Finally, + "overdot" may be used as a synonym for "dotaccent". If the character named in the "accent" position is not in fact a valid accent character, the program interprets the definition @@ -210,22 +210,19 @@ Vpl2vpl Syntax: vpl2vpl -d definition-file [-s shrink-factor] [-c candrabindu-adjustment] [-b] vpl-file -Vpl2vpl creates new TeX virtual fonts based on existing virtual -fonts ("input fonts"). A successful run will read a vpl (Virtual -Property List) file and a definition file, and will generate a new -vpl file on standard output. The input font is assumed to adhere to -the standard TeX encoding for text fonts unless it was created with -the program afm2tfm, in which case it is assumed to conform to the -encoding specified in the file dvips.enc. In either case, the name -of the input font is assumed to be the name of the input file -without its .vpl extension: it must conform to normal TeX -conventions for naming fonts, as vpl2vpl attempts to draw -conclusions from it about the kind of font it is dealing with. - -In the case of a non-virtual font (such as the Computer Modern -fonts), use a pl (Property List) file, created with the standard -utility tftopl, as the input file in place of a vpl file; vpl2vpl -will make the necessary changes on the fly. +Vpl2vpl creates new TeX virtual fonts based on existing fonts or +virtual fonts ("input fonts"). A successful run will read a pl +(Property List) or vpl (Virtual Property List) file and a definition +file, and will generate a new vpl (Virtual Property List) file on +standard output. The input font is assumed to adhere to the standard +TeX encoding for text fonts unless it was created with either of the +programs afm2pl or afm2tfm, in which case it is assumed to conform to +(respectively) the Adobe Standard Encoding or the encoding specified +in the file dvips.enc. In either case, the name of the input font is +assumed to be the name of the input file without its .vpl or .pl +extension: it must conform to normal TeX conventions for naming fonts, +as vpl2vpl attempts to draw conclusions from it about the kind of font +it is dealing with. A typical complete sequence of commands to create a new virtual font might therefore be @@ -253,9 +250,9 @@ certain modifications are made to input fonts following the dvips.enc encoding to bring them into greater conformity with the TeX norm. In particular, the characters dotaccent and hungarumlaut are placed in the positions assigned by TeX ("5F, "7D), not those -enforced by dvips.enc ("C7, "CD). The f-ligatures, double quotes and -dashes are also moved from the upper half of the character set to -their normal TeX positions. As a result, the following characters +enforced by dvips.enc ("C7, "CD). The f-ligatures, double quotes +and dashes are also moved from the upper half of the character set +to their normal TeX positions. As a result, the following characters are not found in the lower half of the character set: quotesingle, quotedbl, backslash, underscore, braceleft, bar, braceright. These characters can, however, be assigned positions in the output font if @@ -265,25 +262,24 @@ their dvips.enc positions if this were desired.) Options: -d should refer to a font definition file. This file (which could - usefully be named, e.g., "French.def") should consist of lines - of character definitions, in the form + usefully be named, e.g., "French.def") should consist of + lines of character definitions, in the form "number" "character" or "number" "character" "accent" - Here "number" represents the character's position in the new encoding and may be expressed in decimal, octal or hex; - "character" names the character (e.g. "comma", "eight", "A") or - consists of the word ".notdef" (indicating that the specified - number's "slot" in the new encoding is to be empty); and - "accent" optionally names an accent to be placed on the - character. In addition to the standard accents available in - PostScript fonts, "underbar" and "underdot" are also available, - as are "under" versions of all the normal superscript accents - ("underdieresis", "underring", etc.). The Indian accent - "candrabindu" may also be specified: it is formed by - overprinting a breve with a dotaccent. Finally, "overdot" may - be used as a synonym for "dotaccent". + "character" names the character (e.g. "comma", "eight", + "A") or consists of the word ".notdef" (indicating that + the specified number's "slot" in the new encoding is to be + empty); and "accent" optionally names an accent to be placed + on the character. In addition to the standard accents available + in PostScript fonts, "underbar" and "underdot" are also + available, as are "under" versions of all the normal + superscript accents ("underdieresis", "underring", etc.). + The Indian accent "candrabindu" may also be specified: it + is formed by overprinting a breve with a dotaccent. Finally, + "overdot" may be used as a synonym for "dotaccent". If the character named in the "accent" position is not in fact a valid accent character, the program interprets the definition @@ -335,22 +331,20 @@ Syntax: vpl2ovp -d definition-file [-s shrink-factor] [-c candrabindu-adjustment] [-b] vpl-file Vpl2ovp creates new Omega virtual fonts based on existing TeX -virtual fonts ("input fonts"). A successful run will read a vpl -(Virtual Property List) file and a definition file, and will generate -a new ovp file on standard output. The input font is assumed to adhere -to the standard TeX encoding for text fonts unless it was created with -the program afm2tfm, in which case it is assumed to conform to the -encoding specified in the file dvips.enc. In either case, the name -of the input font is assumed to be the name of the input file -without its .vpl extension: it must conform to normal TeX -conventions for naming fonts, as vpl2ovp attempts to draw +fonts or virtual fonts ("input fonts"). A successful run will +read a pl (Property List) or vpl (Virtual Property List) file +and a definition file, and will generate a new ovp (Omega +Virtual Property List) file on standard output. The input font +is assumed to adhere to the standard TeX encoding for text +fonts unless it was created with either of the programs afm2pl +or afm2tfm, in which case it is assumed to conform to +(respectively) the Adobe Standard Encoding or the encoding +specified in the file dvips.enc. In either case, the name of +the input font is assumed to be the name of the input file +without its .vpl or .pl extension: it must conform to normal +TeX conventions for naming fonts, as vpl2ovp attempts to draw conclusions from it about the kind of font it is dealing with. -In the case of a non-virtual font (such as the Computer Modern -fonts), use a pl (Property List) file, created with the standard -utility tftopl, as the input file in place of a vpl file; vpl2ovp -will make the necessary changes on the fly. - A typical complete sequence of commands to create a new virtual font might therefore be tftopl cmr10.tfm cmr10.pl @@ -371,16 +365,16 @@ Another approach for a PostScript font is to use afm2tfm: values for the heights of some characters, and this can lead to bad accent placing. -In order to keep the whole of the character range "F0-"FF free -for the requirements of the encoding specified in the definition -file, certain modifications are made to input fonts following the -dvips.enc encoding to bring them into greater conformity with the -TeX norm. In particular, the characters dotaccent and hungarumlaut -are placed in the positions assigned by TeX ("5F, "7D), not those -enforced by dvips.enc ("C7, "CD). The f-ligatures, double quotes -and dashes are also moved from the upper half of the character set -to their normal TeX positions. As a result, the following characters -are not found in the lower half of the character set: quotesingle, +In order to keep the whole of the character range "F0-"FF free for +the requirements of the encoding specified in the definition file, +certain modifications are made to input fonts following the dvips.enc +encoding to bring them into greater conformity with the TeX norm. In +particular, the characters dotaccent and hungarumlaut are placed in +the positions assigned by TeX ("5F, "7D), not those enforced by +dvips.enc ("C7, "CD). The f-ligatures, double quotes and dashes are +also moved from the upper half of the original 8-bit character set to +their normal TeX positions. As a result, the following characters are +not found in the lower half of the character set: quotesingle, quotedbl, backslash, underscore, braceleft, bar, braceright. These characters can, however, be assigned positions in the output font if they are needed. (Indeed, they could all be explicitly restored to @@ -389,7 +383,7 @@ their dvips.enc positions if this were desired.) Options: -d should refer to a font definition file. This file (which could - usefully be named, e.g., "French.def") should consist of + usefully be named, e.g., "Unicode1.def") should consist of lines of character definitions, in the form "number" "character" or @@ -408,6 +402,14 @@ Options: is formed by overprinting a breve with a dotaccent. Finally, "overdot" may be used as a synonym for "dotaccent". + Note that all accents used in defining accented characters must + themselves be defined in the .def file. Those which exist in the + source font should simply be referenced by name in their + appropriate Unicode position (e.g. "0x0304 macron"); those + which do not should be defined as the character "space" + followed by the name of the accent (e.g. "0x0310 space + candrabindu"). + If the character named in the "accent" position is not in fact a valid accent character, the program interprets the definition as a request for a digraph formed from the "character" and the diff --git a/Master/texmf-dist/doc/fonts/accfonts/mkt1font b/Master/texmf-dist/doc/fonts/accfonts/mkt1font index c092673cb3f..a82e9181437 100755 --- a/Master/texmf-dist/doc/fonts/accfonts/mkt1font +++ b/Master/texmf-dist/doc/fonts/accfonts/mkt1font @@ -17,7 +17,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -$version = 0.23; +$version = 0.24; #-----------------------------------------------------------------------------# $description = "Syntax: mkt1font -n fontname -d definition-file -a afm-file -f font-file @@ -181,13 +181,13 @@ while () { # # Encoded chars # - if (/(^C (\d+) ; WX \d+ ; N ([a-zA-Z]+|\.notdef) ; B .* ;( L .* ;)?)\r?$/) { + if (/(^C (\d+) ; WX \d+ ; N ([a-zA-Z_][a-zA-Z0-9_.]*|\.notdef) ; B .* ;( L .* ;)?)\r?$/) { $metrics_enc[$2] = "$1\n"; } # # Unencoded chars # - elsif (/(^C -1 ; WX \d+ ; N ([a-zA-Z]+|\.notdef) ; B .* ;( L .* ;)?)\r?$/) { + elsif (/(^C -1 ; WX \d+ ; N ([a-zA-Z_][a-zA-Z0-9_.]*|\.notdef) ; B .* ;( L .* ;)?)\r?$/) { $metrics_unenc .= "$1\n"; } # @@ -269,7 +269,7 @@ while () { # Store character definitions in %chstrings # $l = $_ = ; - if (/^\/([a-zA-Z]+|\.notdef|\.null) {$/) { + if (/^\/([a-zA-Z_][a-zA-Z0-9_.]*|\.notdef|\.null) {$/) { $chname = $1; $chdef = $_; do { @@ -284,19 +284,18 @@ while () { $chdef =~ s/^(\t})($rend|$renp)$/$1 $2/m; $chstrings{$chname} = $chdef; } - until ($l !~ /^\/([a-zA-Z]+|\.notdef|\.null) {$/); - next; - } - # - # File tail - # - if (/^end$/) { - $distail = $_; - do { - $_ = ; - $distail .= $_; + until ($l !~ /^\/([a-zA-Z_][a-zA-Z0-9_.]*|\.notdef|\.null) {$/); + # + # File tail + # + if (/^end/) { + $distail = $_; + do { + $_ = ; + $distail .= $_; + } + until eof(DIS); } - until eof(DIS); } } close DIS; @@ -327,6 +326,25 @@ $v2 = $capheight - $xheight; # vertical offset for accented caps etc # $itadj = sin($italangle * 3.14159 / 180) / cos($italangle * 3.14159 / 180); +################# +# Create dotlessj +################# +# +$chstrings{dotlessj} = $chstrings{j} . "\n"; +$chstrings{dotlessj} =~ /\A(.*?)(\t[-0-9 ]+?[rvh]moveto)(.*?closepath)(.*?(-?\d+) [rv]moveto.*?closepath)(.*?)\Z/ms; +($one, $two, $three, $four, $five, $six) = ($1, $2, $3, $4, $5, $6); +if ($five > 0) { $chstrings{dotlessj} = $one . $two . $three . $six } +else { + findend("j1", ($two . $three)); + $j1end = "\t$hend{j1} $vend{j1} rmoveto"; + $chstrings{dotlessj} = $one . $j1end . $four . $six +} +$chstrings{dotlessj} =~s/\A\/j /\/dotlessj /m; +$chdefsnum += 1; +getcharinfo("j"); +getcharinfo("dotlessi"); +$metrics_unenc .= "C -1 ; WX $chwd{j} ; N dotlessj ; B $chls{j} $chdp{j} $chrs{j} $chht{dotlessi} ;\n"; + ###################### # Build the characters ###################### @@ -335,7 +353,7 @@ $itadj = sin($italangle * 3.14159 / 180) / cos($italangle * 3.14159 / 180); # First build a list of definitions supplied by user # for (@deflines) { - if (/^\s*(\d+|0[0-7]+|0x[0-9a-fA-F]+)\s+([a-zA-Z]+?|\.notdef)(?:\s+([a-zA-Z]+))?$/) { + if (/^\s*(\d+|0[0-7]+|0x[0-9a-fA-F]+)\s+([a-zA-Z_][a-zA-Z0-9_.]*?|\.notdef)(?:\s+([a-zA-Z_][a-zA-Z0-9_.]*))?$/) { ($num, $char, $acc) = ($1, $2, $3); $num = oct $num if $num =~ /^0/; if ($num > 255) { die "Bad definition (number out of range): $_\n" } @@ -477,7 +495,7 @@ while (@defs) { # open OUTAFM, ">$opt_n.afm"; foreach (@metrics_enc) { # Avoid duplicate entries - ($chname) = /( ; N [a-zA-Z]+ ; )/; + ($chname) = /( ; N [a-zA-Z_][a-zA-Z0-9_.]* ; )/; $metrics_unenc =~ s/^C -1 .*$chname.*\n//gm if $chname; } $chmetricnum = split(/\n/, $metrics_unenc); @@ -490,7 +508,7 @@ for $i (0 .. 255) { $line = $metrics_enc[$i]; if ($line) { print OUTAFM $line; - if ($line =~ /^C \d+ ; WX \d+ ; N ([a-zA-Z]*) ; /) { + if ($line =~ /^C \d+ ; WX \d+ ; N ([a-zA-Z_][a-zA-Z0-9_.]*) ; /) { $encoding .= "dup $i /$1 put\n"; } } @@ -530,17 +548,17 @@ $disbanner .= "% Command line: $cmdline"; open DIS, $disfile1; while () { # get header s/^(%!.*: ).*$/$1$opt_n\n$disbanner/; - s/^(\/FullName \().*(\).*)$/$1$opt_n$2/; - s/^(\/FamilyName \().*(\).*)$/$1$famname$2/; - s/^(\/FontName \/).*?( .*)$/$1$opt_n$2/; - s/^(\/FontBBox {-?\d+ )-?\d+ -?\d+ -?\d+/$1$maxdp $maxrs $maxht/m; + s/(\/FullName \().*(\).*)$/$1$opt_n$2/; + s/(\/FamilyName \().*(\).*)$/$1$famname$2/; + s/(\/FontName \/).*?( .*)$/$1$opt_n$2/; + s/(\/FontBBox {-?\d+ )-?\d+ -?\d+ -?\d+/$1$maxdp $maxrs $maxht/m; if (/^\/Encoding /) { print OUTDIS $encoding; next; } - next if (/^\/UniqueID .*$/); - s /^(\/BlueValues \[.*)(\] def)$/$1 $accheight $accheight$2/; - if (/^(\/Subrs )\d+( array)$/) { + next if (/\/UniqueID .*$/); + s /(\/BlueValues \[.*)(\] def)$/$1 $accheight $accheight$2/; + if (/(\/Subrs )\d+( array)$/) { print OUTDIS "$1$subrsnum$2\n"; last; } @@ -596,6 +614,7 @@ sub supacc { ($old = $metrics_enc[$num]) =~ s/^C $num/C -1/; $metrics_unenc .= $old unless $metrics_unenc =~ /$old/m; if ($char eq "i") { $char = "dotlessi" } + if ($char eq "j") { $char = "dotlessj" } if ($acc eq "overdot") { $acc = "dotaccent" } if ($acc eq "candrabindu") { $acc = "breve"; @@ -784,7 +803,7 @@ sub digraph { $astr .= (max($chht{$char}, $chht{$acc})) . " ;\n"; $metrics_enc[$num] = $astr; unless (defined $hend{$char}) { findend($char, $chstrings{$char}) } - $H = $chwd{$char} + $chls{$acc} + $kern - $hend{$char} - $chls{$char}; + $H = $chwd{$char} + $chls{$acc} + $kern - $hend{$char}; $V = -$vend{$char}; $chstrings{$char} =~ /^\/$char {\n(\t.+?hsbw\n(.|\n)*?)\tendchar\n\t} $rend\n/m; ($chdef = $1) =~ s/-?\d+( hsbw\n)/$w$1/m; @@ -897,12 +916,16 @@ sub fixshrink { sub fixhints { # - # Collect the hints from the accent definition, remove them, adjust - # for horizontal and vertical offset, and place them in a numbered - # subroutine. Have the definition call the subroutine. + # First adjust any Flex "0 callsubr" lines for horizontal and + # vertical offset. Then collect the hints from the accent definition, + # remove them, adjust for horizontal and vertical offset, and + # place them in a numbered subroutine. Have the definition call + # the subroutine. # my ($nchar, $acc, $acdef, $h, $v) = @_; my $subrdef; + $acdef =~ s[^(\t-?\d+ )(-?\d+) (-?\d+)( 0 callsubr)$] + [$1 . ($2 + $h) . " " . ($3 + $v) . $4]gme; if ($subrdef = join("\n", grep /^\t.*[hv]stem$/, split(/\n/, $acdef))) { $acdef = join("\n", grep !/^\t.*[hv]stem$/, split(/\n/, $acdef)) . "\n"; } @@ -970,9 +993,10 @@ sub findend { findend($char, $subrs[$1]); last SWITCH; }; - $line =~ /1 callothersubr$/ + $line =~ /^\t-?\d+ (-?\d+) (-?\d+) 0 callsubr$/ # Flex && do { - print STDERR "Warning: definition of character $char uses Flex\n"; + $hend{$char} = $1; + $vend{$char} = $2; last SWITCH; }; } diff --git a/Master/texmf-dist/doc/fonts/accfonts/vpl2ovp b/Master/texmf-dist/doc/fonts/accfonts/vpl2ovp index 3bbc62ad669..a49259699a8 100755 --- a/Master/texmf-dist/doc/fonts/accfonts/vpl2ovp +++ b/Master/texmf-dist/doc/fonts/accfonts/vpl2ovp @@ -17,29 +17,27 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -$version = 0.23; +$version = 0.24; #------------------------------------------------------------------------# $description = "Syntax: vpl2ovp -d definition-file [-s shrink-factor] [-c candrabindu-adjustment] [-b] vpl-file Vpl2ovp creates new Omega virtual fonts based on existing TeX -virtual fonts (\"input fonts\"). A successful run will read a vpl -(Virtual Property List) file and a definition file, and will generate -a new ovp file on standard output. The input font is assumed to adhere -to the standard TeX encoding for text fonts unless it was created with -the program afm2tfm, in which case it is assumed to conform to the -encoding specified in the file dvips.enc. In either case, the name -of the input font is assumed to be the name of the input file -without its .vpl extension: it must conform to normal TeX -conventions for naming fonts, as vpl2ovp attempts to draw +fonts or virtual fonts (\"input fonts\"). A successful run will +read a pl (Property List) or vpl (Virtual Property List) file +and a definition file, and will generate a new ovp (Omega +Virtual Property List) file on standard output. The input font +is assumed to adhere to the standard TeX encoding for text +fonts unless it was created with either of the programs afm2pl +or afm2tfm, in which case it is assumed to conform to +(respectively) the Adobe Standard Encoding or the encoding +specified in the file dvips.enc. In either case, the name of +the input font is assumed to be the name of the input file +without its .vpl or .pl extension: it must conform to normal +TeX conventions for naming fonts, as vpl2ovp attempts to draw conclusions from it about the kind of font it is dealing with. -In the case of a non-virtual font (such as the Computer Modern -fonts), use a pl (Property List) file, created with the standard -utility tftopl, as the input file in place of a vpl file; vpl2ovp -will make the necessary changes on the fly. - A typical complete sequence of commands to create a new virtual font might therefore be tftopl cmr10.tfm cmr10.pl @@ -60,16 +58,16 @@ Another approach for a PostScript font is to use afm2tfm: values for the heights of some characters, and this can lead to bad accent placing. -In order to keep the whole of the character range \"F0-\"FF free -for the requirements of the encoding specified in the definition -file, certain modifications are made to input fonts following the -dvips.enc encoding to bring them into greater conformity with the -TeX norm. In particular, the characters dotaccent and hungarumlaut -are placed in the positions assigned by TeX (\"5F, \"7D), not those -enforced by dvips.enc (\"C7, \"CD). The f-ligatures, double quotes -and dashes are also moved from the upper half of the character set -to their normal TeX positions. As a result, the following characters -are not found in the lower half of the character set: quotesingle, +In order to keep the whole of the character range \"F0-\"FF free for +the requirements of the encoding specified in the definition file, +certain modifications are made to input fonts following the dvips.enc +encoding to bring them into greater conformity with the TeX norm. In +particular, the characters dotaccent and hungarumlaut are placed in +the positions assigned by TeX (\"5F, \"7D), not those enforced by +dvips.enc (\"C7, \"CD). The f-ligatures, double quotes and dashes are +also moved from the upper half of the original 8-bit character set to +their normal TeX positions. As a result, the following characters are +not found in the lower half of the character set: quotesingle, quotedbl, backslash, underscore, braceleft, bar, braceright. These characters can, however, be assigned positions in the output font if they are needed. (Indeed, they could all be explicitly restored to @@ -78,7 +76,7 @@ their dvips.enc positions if this were desired.) Options: -d should refer to a font definition file. This file (which could - usefully be named, e.g., \"French.def\") should consist of + usefully be named, e.g., \"Unicode1.def\") should consist of lines of character definitions, in the form \"number\" \"character\" or @@ -97,6 +95,14 @@ Options: is formed by overprinting a breve with a dotaccent. Finally, \"overdot\" may be used as a synonym for \"dotaccent\". + Note that all accents used in defining accented characters must + themselves be defined in the .def file. Those which exist in the + source font should simply be referenced by name in their + appropriate Unicode position (e.g. \"0x0304 macron\"); those + which do not should be defined as the character \"space\" + followed by the name of the accent (e.g. \"0x0310 space + candrabindu\"). + If the character named in the \"accent\" position is not in fact a valid accent character, the program interprets the definition as a request for a digraph formed from the \"character\" and the @@ -602,12 +608,10 @@ while (@defs) { delete $allchars{$nchar2}; } # - # If the character is not a single codepoint (i.e. if it is stored - # in the Private Use Area), store the info that will be needed to - # have it linked into the LIGTABLE + # Store the info that will be needed to have the character + # linked into the LIGTABLE # - push @pualigs, "$char: (LIG $acc $nchar)"; - if (!defined $allchars{$acc}) { dummychar($dummycodepoint--, $acc) } + push @newligs, "$char: (LIG $acc $nchar)"; # # Go! # @@ -638,14 +642,14 @@ while (@defs) { # Sort out ligtable ################### # -# Pull in the Private Use Area ligatures +# Pull in the newly created ligatures # -foreach $pualig (@pualigs) { - $pualig =~ s/^(.+)://; - $puaelm1 = $1; - unless ($ligs =~ s/(^ \(LABEL $puaelm1\)\n)/$1$pualig\n/m) { +foreach $newlig (@newligs) { + $newlig =~ s/^(.+)://; + $newelm1 = $1; + unless ($ligs =~ s/(^ \(LABEL $newelm1\)\n)/$1$newlig\n/m) { $ligs =~ s[^( \)\n)] - [ \(LABEL $puaelm1\)\n$pualig\n \(STOP\)\n$1]m + [ \(LABEL $newelm1\)\n$newlig\n \(STOP\)\n$1]m } } # @@ -965,6 +969,20 @@ sub underb { $s3 = "(SETRULE R ${ \($thk) } R $w)"; $allchars{$id}{map} = " $s1\n$s2$s3\n"; $chars[$num] = $allchars{$id}; + # + # If the character to be underscored is a digraph, fix up the LIGTABLE + # + if (grep /^$char$/, @digraphs) { + pop @newligs; + dummychar(0x035F, "uni035F") unless defined $allchars{uni035F}; + $char =~ /^(.)(.)$/; + ($one, $two) = ($1, $2); + $one_ = $one . "_uni035F"; + dummychar($dummycodepoint--, $one_) unless defined $allchars{$one_}; + push @newligs, "$one: (LIG uni035F $one_)" + unless (grep /^$one: \(LIG uni035F $one_\)$/, @newligs); + push @newligs, "$one_: (LIG $two $id)"; + } } sub digraph { @@ -974,17 +992,14 @@ sub digraph { my ($num, $char, $acc, $id) = @_; my ($one, $two, $kern, $s1, $s2, $charZWJ); # - # Fiddle the ligature info to include Zero Width Joiner + # Remove the ligature info -- we don't want every occurrence of + # e.g."kh" to be converted into a digraph. # - if (!defined $allchars{ZWJ}) { - dummychar(0x200D, ZWJ) - } - pop @pualigs; - $charZWJ = $char . "ZWJ"; - dummychar($dummycodepoint--, $charZWJ) unless defined $allchars{$charZWJ}; - push @pualigs, "$char: (LIG ZWJ $charZWJ)" - unless (grep /^$char: \(LIG ZWJ $charZWJ\)$/, @pualigs); - push @pualigs, "$charZWJ: (LIG $acc $id)"; + pop @newligs; + # + # List all digraphs for future reference + # + push @digraphs, $id; if ($ligs =~ /^ \(LABEL $char\)\n(.*?)\n \(KRN $acc R (-?[0-9.]+)\)\n/ms) { ($one, $two) = ($1, $2); } diff --git a/Master/texmf-dist/doc/fonts/accfonts/vpl2vpl b/Master/texmf-dist/doc/fonts/accfonts/vpl2vpl index d1e34e19dda..18bd1c4676c 100755 --- a/Master/texmf-dist/doc/fonts/accfonts/vpl2vpl +++ b/Master/texmf-dist/doc/fonts/accfonts/vpl2vpl @@ -17,28 +17,25 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -$version = 0.23; +$version = 0.24; #------------------------------------------------------------------------# $description = "Syntax: vpl2vpl -d definition-file [-s shrink-factor] [-c candrabindu-adjustment] [-b] vpl-file -Vpl2vpl creates new TeX virtual fonts based on existing virtual -fonts (\"input fonts\"). A successful run will read a vpl (Virtual -Property List) file and a definition file, and will generate a new -vpl file on standard output. The input font is assumed to adhere to -the standard TeX encoding for text fonts unless it was created with -the program afm2tfm, in which case it is assumed to conform to the -encoding specified in the file dvips.enc. In either case, the name -of the input font is assumed to be the name of the input file -without its .vpl extension: it must conform to normal TeX -conventions for naming fonts, as vpl2vpl attempts to draw -conclusions from it about the kind of font it is dealing with. - -In the case of a non-virtual font (such as the Computer Modern -fonts), use a pl (Property List) file, created with the standard -utility tftopl, as the input file in place of a vpl file; vpl2vpl -will make the necessary changes on the fly. +Vpl2vpl creates new TeX virtual fonts based on existing fonts or +virtual fonts (\"input fonts\"). A successful run will read a pl +(Property List) or vpl (Virtual Property List) file and a definition +file, and will generate a new vpl (Virtual Property List) file on +standard output. The input font is assumed to adhere to the standard +TeX encoding for text fonts unless it was created with either of the +programs afm2pl or afm2tfm, in which case it is assumed to conform to +(respectively) the Adobe Standard Encoding or the encoding specified +in the file dvips.enc. In either case, the name of the input font is +assumed to be the name of the input file without its .vpl or .pl +extension: it must conform to normal TeX conventions for naming fonts, +as vpl2vpl attempts to draw conclusions from it about the kind of font +it is dealing with. A typical complete sequence of commands to create a new virtual font might therefore be -- cgit v1.2.3