Re: [PATCH] Proper use of font encodings for "native" fonts
Hi Rainer, Thanks alot. I have committed the patch. It all looks fine and appears to be working how it should (as far as I can see). Keiron. On Thu, 2002-06-27 at 23:42, Rainer Garus wrote: > Attached is the patch for the development version of fop. > > Some remarks: > > 1) With ant version 1.4.1 ant-optional.jar is not needed. > 2) There are two new files src/codegen/encodings.xml and src/codegen/glyphlist.xml. > 3) I have problems building fop with xalan version 2.2D11 (see bug 9706 for ant). >Please upgrade to an actual xalan version. > 4) Only building of fop is tested (with the snapshot 20020626162309 and with xalan >version 2.3.1). > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: [PATCH] Proper use of font encodings for "native" fonts
Attached is the patch for the development version of fop. Some remarks: 1) With ant version 1.4.1 ant-optional.jar is not needed. 2) There are two new files src/codegen/encodings.xml and src/codegen/glyphlist.xml. 3) I have problems building fop with xalan version 2.2D11 (see bug 9706 for ant). Please upgrade to an actual xalan version. 4) Only building of fop is tested (with the snapshot 20020626162309 and with xalan version 2.3.1). development.zip Description: Zip archive - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: [PATCH] Proper use of font encodings for "native" fonts
Keiron Liddle schrieb: > One reason for waiting was to see how it would work. There are some user > issues that have popped up but nothing too serious. It would be good to > know how people should deal with this situation. > > A new patch would certainly help. Christian might be able to say more > about this. Ok (sorry a bit late) .. the patch corrected the mapping of the symbol fonts (more precise: the mapping of characters with a unicode value >255) This causes a problem with old stylesheets (if the affected characters are used) but a pointer to docs/examples/fo/fonts.fo seemes to resolve the issue. Yes, a new patch from Rainer would be nice. Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: [PATCH] Proper use of font encodings for "native" fonts
One reason for waiting was to see how it would work. There are some user issues that have popped up but nothing too serious. It would be good to know how people should deal with this situation. A new patch would certainly help. Christian might be able to say more about this. On Sun, 2002-05-12 at 18:35, Rainer Garus wrote: > The patch in http://marc.theaimsgroup.com/?l=fop-dev&m=101242543132144&w=2 is only >inserted in the maintenance branch, not in the main branch. Is the patch not accepted >for the main branch? Due to changes in the main branch, the patch does not work for >the main branch in the moment without modifications. It is necessary to send a new >patch? > > Rainer Garus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
[PATCH] Proper use of font encodings for "native" fonts
The patch in http://marc.theaimsgroup.com/?l=fop-dev&m=101242543132144&w=2 is only inserted in the maintenance branch, not in the main branch. Is the patch not accepted for the main branch? Due to changes in the main branch, the patch does not work for the main branch in the moment without modifications. It is necessary to send a new patch? Rainer Garus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: [PATCH] Proper use of font encodings for "native" fonts
Arved Sandstrom wrote: > Hell, why not. :-) Well, I'm a just bit worried that this patch could introduce new bugs... > I don't know what your schedule is like...me, I really need to do my work on > Saturday (uploading Peter West's stuff, mostly). Is that too long for you to > wait? Tonight and tomorrow night, as earlier this week, I am pretty busy. As I'm quite busy too (as always..) and have also planed to do my stuff on the weekend. > far as I am concerned the release candidate is available and reasonably > functional so we are not in a great hurry. Ok. Any news on the licensing issues ? > Arved Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: [PATCH] Proper use of font encodings for "native" fonts
Hell, why not. :-) I don't know what your schedule is like...me, I really need to do my work on Saturday (uploading Peter West's stuff, mostly). Is that too long for you to wait? Tonight and tomorrow night, as earlier this week, I am pretty busy. As far as I am concerned the release candidate is available and reasonably functional so we are not in a great hurry. Arved -Original Message- From: Christian Geisert [mailto:[EMAIL PROTECTED]] Sent: January 31, 2002 2:11 PM To: [EMAIL PROTECTED] Subject: Re: [PATCH] Proper use of font encodings for "native" fonts Arved Sandstrom wrote: > Noted. Do you want to include this in the coming release ? Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: [PATCH] Proper use of font encodings for "native" fonts
Arved Sandstrom wrote: > Noted. Do you want to include this in the coming release ? Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: [PATCH] Proper use of font encodings for "native" fonts
Noted. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Rainer Garus Sent: January 30, 2002 5:18 PM To: [EMAIL PROTECTED] Subject: Re: [PATCH] Proper use of font encodings for "native" fonts References: [1] http://marc.theaimsgroup.com/?l=fop-dev&m=100559770232644&w=2 [2] http://marc.theaimsgroup.com/?l=fop-dev&m=100790930100949&w=2 [3] http://marc.theaimsgroup.com/?l=fop-dev&m=100386481704186&w=2 In fop 0.20.x unicode characters with value greater 256 not represented in the font are substituted with the character '#'. With the patch [1] all characters not represented in the font are substituted. This makes a problem in LineArea.getCharWidth. Because the line feed character has no glyph the width of the line feed is computed to the width of the '#' character and is unequal to the space character. This is the reason for the second problem described in [2]. Attached is a simple patch for fop 0.20.3RC to solve the problem. The patch from Peter [1](together with the two updates) can now entered in cvs in the maintenance branch. The patch [1](together with the first update in [2]) should be entered in cvs in the main branch. The design is easier to understand and the patch solves some design problems [3]. The attached patch (second update) is not necessary for the main branch in the moment. I think it is better to wait until the patch is in cvs and then to change the interface of the font subsystem. If a character is not contained in a font, the font subsystem should generate an exception. The area tree builder can then decide to substitute the character or to print a warning message. Rainer Garus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: [PATCH] Proper use of font encodings for "native" fonts
References: [1] http://marc.theaimsgroup.com/?l=fop-dev&m=100559770232644&w=2 [2] http://marc.theaimsgroup.com/?l=fop-dev&m=100790930100949&w=2 [3] http://marc.theaimsgroup.com/?l=fop-dev&m=100386481704186&w=2 In fop 0.20.x unicode characters with value greater 256 not represented in the font are substituted with the character '#'. With the patch [1] all characters not represented in the font are substituted. This makes a problem in LineArea.getCharWidth. Because the line feed character has no glyph the width of the line feed is computed to the width of the '#' character and is unequal to the space character. This is the reason for the second problem described in [2]. Attached is a simple patch for fop 0.20.3RC to solve the problem. The patch from Peter [1](together with the two updates) can now entered in cvs in the maintenance branch. The patch [1](together with the first update in [2]) should be entered in cvs in the main branch. The design is easier to understand and the patch solves some design problems [3]. The attached patch (second update) is not necessary for the main branch in the moment. I think it is better to wait until the patch is in cvs and then to change the interface of the font subsystem. If a character is not contained in a font, the font subsystem should generate an exception. The area tree builder can then decide to substitute the character or to print a warning message. Rainer Garus --- Fop-0.20.3rc/src/org/apache/fop/layout/LineArea.javaSat Jan 19 17:15:36 2002 +++ Fop1/src/org/apache/fop/layout/LineArea.javaWed Jan 30 19:46:52 2002 @@ -1235,51 +1235,53 @@ * versions of space that might not exists in the font. */ private int getCharWidth(char c) { -int width = currentFontState.width(currentFontState.mapChar(c)); -if (width <= 0) { -// Estimate the width of spaces not represented in -// the font -int em = currentFontState.width(currentFontState.mapChar('m')); -int en = currentFontState.width(currentFontState.mapChar('n')); -if (em <= 0) -em = 500 * currentFontState.getFontSize(); -if (en <= 0) -en = em - 10; +int width; -if (c == ' ') -width = em; -if (c == '\u2000') -width = en; -if (c == '\u2001') -width = em; -if (c == '\u2002') -width = em / 2; -if (c == '\u2003') -width = currentFontState.getFontSize(); -if (c == '\u2004') -width = em / 3; -if (c == '\u2005') -width = em / 4; -if (c == '\u2006') -width = em / 6; -if (c == '\u2007') -width = getCharWidth(' '); -if (c == '\u2008') -width = getCharWidth('.'); -if (c == '\u2009') -width = em / 5; -if (c == '\u200A') -width = 5; -if (c == '\u200B') -width = 100; -if (c == '\u00A0') -width = getCharWidth(' '); -if (c == '\u202F') -width = getCharWidth(' ') / 2; -if (c == '\u3000') -width = getCharWidth(' ') * 2; -if ((c == '\n') || (c == '\r') || (c == '\t')) -width = getCharWidth(' '); +if ((c == '\n') || (c == '\r') || (c == '\t') || (c == '\u00A0')) { +width = getCharWidth(' '); +} else { +width = currentFontState.width(currentFontState.mapChar(c)); +if (width <= 0) { +// Estimate the width of spaces not represented in +// the font +int em = currentFontState.width(currentFontState.mapChar('m')); +int en = currentFontState.width(currentFontState.mapChar('n')); +if (em <= 0) +em = 500 * currentFontState.getFontSize(); +if (en <= 0) +en = em - 10; + +if (c == ' ') +width = em; +if (c == '\u2000') +width = en; +if (c == '\u2001') +width = em; +if (c == '\u2002') +width = em / 2; +if (c == '\u2003') +width = currentFontState.getFontSize(); +if (c == '\u2004') +width = em / 3; +if (c == '\u2005') +width = em / 4; +if (c == '\u2006') +width = em / 6; +if (c == '\u2007') +width = getCharWidth(' '); +if (c == '\u2008') +width = getCharWidth('.'); +if (c == '\u2009') +width = em / 5; +if (c == '\u200A') +
RE: [PATCH] Proper use of font encodings for "native" fonts
Ok, I've added the LineArea remainingWidth patch and the euro metric patches to fop-0_20_2-maintain. I wait to commit Peter's patch until the issues mentioned by Rainer is fixed. I also added a batik.jar based on the 1.1 distribution. I've only tested it with the documents in docs\examples\svg. Tore > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Rainer Garus > Sent: Sunday, December 09, 2001 15:48 > To: [EMAIL PROTECTED] > Subject: Re: [PATCH] Proper use of font encodings for "native" fonts > > > Hi Peter, > > I have installed the patch to the 0.20.2RC version and tested > with the fonts.fo example. There are two problems (see attached > file fonts.pdf): > > First, the euro sign is not displayed, because of a bug in the > class CodePointMapping. Not all of the unicode characters with > value greater 256 are entered in the characters and codepoints > arrays (see the attached patch file). > > Second, the distance in the pdf-file of the last character of a > line and the second character of the next line of the fo-file is > twice of the distance between the other characters. You can see > this very good in the section with the ZapfDingbats font between > the digits. This prevents me from using your patch. > > Rainer Garus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: [PATCH] Proper use of font encodings for "native" fonts
Hi Peter, I have installed the patch to the 0.20.2RC version and tested with the fonts.fo example. There are two problems (see attached file fonts.pdf): First, the euro sign is not displayed, because of a bug in the class CodePointMapping. Not all of the unicode characters with value greater 256 are entered in the characters and codepoints arrays (see the attached patch file). Second, the distance in the pdf-file of the last character of a line and the second character of the next line of the fo-file is twice of the distance between the other characters. You can see this very good in the section with the ZapfDingbats font between the digits. This prevents me from using your patch. Rainer Garus http://www.w3.org/1999/XSL/Format";> Helvetica ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ Œ œ Š š Ÿ Ž ž ƒ ˜ – — ‘ ’ ‚ “ ” „ † ‡ • … ‰ ‹ › ™ Times Roman ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ Œ œ Š š Ÿ Ž ž ƒ ˜ – — ‘ ’ ‚ “ ” „ † ‡ • … ‰ ‹ › ™ Courier ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ Œ œ Š š Ÿ Ž ž ƒ ˜ – — ‘ ’ ‚ “ ” „ † ‡ • … ‰ ‹ › ™ ZapfDingbats: ✁ ✂ ✃ ✄ ☎ ✆ ✇ ✈ ✉ ☛ ☞ ✌ ✍ ✎ ✏ ✐ ✑ ✒ ✓ ✔ ✕ ✖ ✗ ✘ ✙ ✚ ✛ ✜ ✝ ✞ ✟ ✠ ✡ ✢ ✣ ✤ ✥ ✦ ✧ ★ ✩ ✪ ✫ ✬ ✭ ✮ ✯ ✰ ✱ ✲ ✳ ✴ ✵ ✶ ✷ ✸ ✹ ✺ ✻ ✼ ✽ ✾ ✿ ❀ ❁ ❂ ❃ ❄ ❅ ❆ ❇ ❈ ❉ ❊ ❋ ● ❍ ■ ❏ ❐ ❑ ❒ ▲ ▼ ◆ ❖ ◗ ❘ ❙ ❚ ❛ ❜ ❝ ❞ ❡ ❢ ❣ ❤ ❥ ❦ ❧ ♣ ♦ ♥ ♠ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾ ❿ ➀ ➁ ➂ ➃ ➄ ➅ ➆ ➇ ➈ ➉ ➊ ➋ ➌ ➍ ➎ ➏ ➐ ➑ ➒ ➓ ➔ → ↔ ↕ ➘ ➙ ➚ ➛ ➜ ➝ ➞ ➟ ➠ ➡ ➢ ➣ ➤ ➥ ➦ ➧ ➨ ➩ ➪ ➫ ➬ ➭ ➮ ➯ ➱ ➲ ➳ ➴ ➵ ➶ ➷ ➸ ➹ ➺ ➻ ➼ ➽ ➾ Symbol: ! # % & ( ) + , . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? [ ] _ m { | } ¬ ° ± µ × ÷ ƒ Α Β Γ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ α β γ δ ε ζ η θ ι κ λ ν ξ ο π ρ ς σ τ υ φ χ ψ ω ϑ ϒ ϕ ϖ • … ′ ″ ⁄ ℑ ℘ ℜ Ω ℵ ← ↑ → ↓ ↔ ↵ ⇐ ⇑ ⇒ ⇓ ⇔ ∀ ∂ ∃ ∅ ∆ ∇ ∈ ∉ ∋ ∏ ∑ − ∗ √ ∝ ∞ ∠ ∧ ∨ ∩ ∪ ∫ ∴ ∼ ≅ ≈ ≠ ≡ ≤ ≥ ⊂ ⊃ ⊄ ⊆ ⊇ ⊕ ⊗ ⊥ ⋅ ⌠ ⌡ 〈 〉 ◊ ♠ ♣ ♥ ♦ Some special characters: Euro ( dec 8364, hex 20AC): € --- Fop1/src/codegen/code-point-mapping.xsl Mon Nov 12 23:37:19 2001 +++ Fop2/src/codegen/code-point-mapping.xsl Sat Dec 8 23:04:13 2001 @@ -28,8 +28,8 @@ char c = (char) table[i+1]; if(c >= 256) { ++top; - for(int j = top - 1; j > 0; --j) { - if(characters[j-1] >= c) { + for(int j = top - 1; j >= 0; --j) { + if(j > 0 && characters[j-1] >= c) { characters[j] = characters[j-1]; codepoints[j] = codepoints[j-1]; } else { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
[PATCH] Proper use of font encodings for "native" fonts
One of the major annoyances for me as I tried to use FOP has been that it didn't try very hard to get the encodings of the Symbol and ZapfDingbats fonts right. In particular, using the proper Unicode characters for glyphs in these fonts wasn't possible. The enclosed patch (against 0.20.2, though it should apply cleanly against the CVS HEAD version) fixes the encoding mechanism. It splits charlist.xml (which only covered WinAnsiEncoding) into two files, glyphlist.xml (containing the official Adobe Glyph List and Zapf Dingbats glyph lists), and encodings.xml (containing all of the standard Adobe encodings). This forces the build process to do a relational "join" on the two files to generate CodePointMapping.java, slowing it down a little bit. It still uses the WinAnsiEncoding for text fonts because this vector gives the best coverage. Building with -Dtextfontencoding=MacRomanEncoding or -Dtextfontencoding=MacExpertEncoding should work too, and allow a different subset of the font characters in the native text fonts. With the addition of code to output encoding vectors, other encodings (such as CEEncoding) could be used. Note that this patch requires that the ant distribution's "optional.jar" be added to lib. -Peter S. Housel- [EMAIL PROTECTED] http://members.home.com/housel/ fop-encoding.zip Description: Zip archive - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]