Re: [NTG-context] Not wanted hidden spaces when you compress fonts
![](https://secure.gravatar.com/avatar/ddb19d0655fedd5d525a6d10eba5527f.jpg?s=120&d=mm&r=g)
Hello, when I turn off the compression [extend=0.8] -> [extend=1] the problems are gone :-) ... the compression unfourtunately also :-( What do I have to configure to get the compression without spaces? :-) Regards Jannis ===== copy Hello, if I compress a font, there are suddenly hidden spaces between words. You can't see the spaces in the PDF, but when you copy the text from the PDF to an editor you can see the spaces. And when you search for a word (with hidden spaces) in the PDF, the word can't be found. This is the result when you copy the text from the PDF into an editor: "The quick brow n fox jum ps over the lazy dog." There is a space in "brow n" and one in "jum ps". When you search for "brown" in the PDF you get no result. Here is an example: \definefontfeature[cond][default][extend=0.8] \usemodule[simplefonts] \setmainfont[Allerlight][features=cond] \starttext The quick brown fox jumps over the lazy dog. \stoptext How to get rid of this hidden spaces? Regards Jannis
![](https://secure.gravatar.com/avatar/ff69818a67b9057127088b8b47311aa3.jpg?s=120&d=mm&r=g)
Dear Jan,
when I turn off the compression [extend=0.8] -> [extend=1] the problems are gone :-) ... the compression unfourtunately also :-( What do I have to configure to get the compression without spaces? :-)
I guess you will need a new font, or a new version of the same font with compression. I am sure there are tools out there that can do the compression of a font. As far as I understand, TeX itself knows nothing about the glyphs. They are just some boxes for the TeX engine. It does not handle the glyphs itself -- TeX just places them. So the only way TeX has to compress fonts is to push the glyphs closer together -- thus introducing these 'spaces' (in fact, they are negative spaces, places where TeX interrupts words to push the glyphs closer together). In very special cases you might be able to use postscript's (or pdf's) transformation engine to archieve condensed fonts. I once used that by creating a minipage with 'normal' font within a picture environment that itself then did the transformation. But I guess that's not what you really are after. Hope that helps, Susan
![](https://secure.gravatar.com/avatar/93131e1e6e2204bd13501390d768dbdc.jpg?s=120&d=mm&r=g)
Am 06.01.2012 um 12:23 schrieb Susan Dittmar:
Dear Jan,
when I turn off the compression [extend=0.8] -> [extend=1] the problems are gone :-) ... the compression unfourtunately also :-( What do I have to configure to get the compression without spaces? :-)
I guess you will need a new font, or a new version of the same font with compression. I am sure there are tools out there that can do the compression of a font.
As far as I understand, TeX itself knows nothing about the glyphs. They are just some boxes for the TeX engine. It does not handle the glyphs itself -- TeX just places them. So the only way TeX has to compress fonts is to push the glyphs closer together -- thus introducing these 'spaces' (in fact, they are negative spaces, places where TeX interrupts words to push the glyphs closer together).
In very special cases you might be able to use postscript's (or pdf's) transformation engine to archieve condensed fonts. I once used that by creating a minipage with 'normal' font within a picture environment that itself then did the transformation. But I guess that's not what you really are after.
As you can in the example below the font is stretched to the given value but the problem when you copy the text can be in the algorithm Adobe Reader use to determine spaces in the text. \starttext \define[1]\ExtendFont {\definefontfeature[condensed][default][extend=#1] \definedfont[name:allerlight*condensed]The quick brown fox jumps over the lazy dog.\endgraf} \processcommalist[0.4,0.6,0.8,1.0,1.2,1.4]\ExtendFont \stoptext Wolfgang
participants (3)
-
Jan Heinen
-
Susan Dittmar
-
Wolfgang Schuster