No selection

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

No selection

Peter Dyballa
Hello!

I invoke my script with one argument: fc2rt8a.ttf.

The script opens a to PostScript converted TrueType font, excerpts 248
glyphs, copies them into another font font, and encodes this in TeX's
8r encoding. It goes:

        r8      = Array(248)
        r8[0]   = 0u0020
        r8[1]   = 0u0021
        r8[2]   = 0u0022
        ...
        r8[245] = 0uFB02
        r8[246] = 0uFB03
        r8[247] = 0uFB04
        #
        bis   = Strstr($1,".")
        Stamm = Strsub($1,0,bis)
        #
        aus = Stamm + ".pfb"
        Open(aus)
        Fehler = SelectIf(r8)
        Print("Der Fehler der Glyphenauswahl ist: ", Fehler)
        Copy()
        Paste()
        LoadEncodingFile("8r.enc")
        Reencode("TeXBase1Encoding")
        bis  -= 1
        Stamm = Strsub($1,0,bis)
        aus   = Stamm + "r.sfd"
        Save(aus)
        Open(aus)
        aus  = Stamm + "r.pfb"
        Generate(aus)
        Quit(Fehler)

During execution I get:

        Fehler = SelectIf(r8)
        Print("Der Fehler der Glyphenauswahl ist: ", Fehler)
        Der Fehler der Glyphenauswahl ist: -2 => there was an error and no
glyphs were selected
        Copy()
        No selection
        Paste()
        No Selection

What is here going wrong? In the end I get a complete copy of the whole
Code2002 font with 30469 glyphs.

Can reencoding succeed when all glyph names are
"uni<hex><hex><hex><hex>" or "uni<hex><hex><hex><hex><hex>?"

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



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
Reply | Threaded
Open this post in threaded view
|

Re: No selection

George Williams
On Sat, 2005-06-11 at 16:02, Peter Dyballa wrote:
> I invoke my script with one argument: fc2rt8a.ttf.
I'm afraid I have absolutely no idea what your script is trying to do.

If you want to generate a font with a 8r encoding all you need to do is:
        Open("foo.ttf")
        Reencode("TeX8r")
        SetCharCnt(256)
        GenerateFont("foo-8r.pfb")

> Can reencoding succeed when all glyph names are
> "uni<hex><hex><hex><hex>" or "uni<hex><hex><hex><hex><hex>?"
Yes. Though the recommended syntax is "u<hex><hex><hex><hex><hex>" for
the second form.



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
Reply | Threaded
Open this post in threaded view
|

Re: No selection

George Williams
In reply to this post by Peter Dyballa
On Sat, 2005-06-11 at 16:02, Peter Dyballa wrote:
> r8      = Array(248)
> r8[0]   = 0u0020
> r8[1]   = 0u0021
> r8[2]   = 0u0022

> Fehler = SelectIf(r8)

> During execution I get:
>
> Fehler = SelectIf(r8)
> Print("Der Fehler der Glyphenauswahl ist: ", Fehler)
> Der Fehler der Glyphenauswahl ist: -2 => there was an error and no
> glyphs were selected
If you pass a selection array to Select() it expects something of the
form returned by $selection, which is an array whose size is the same as
the number of encoding slots in the font and where each entry is either
0 or 1 indicating that the associated encoding slot is either
not-selected or selected.

Sorry for not making that clearer. I'll update the docs.

Your array doesn't fit this, so you get errors. But you really don't
want to do this at all. See my previous e-mail.



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
Reply | Threaded
Open this post in threaded view
|

Re: No selection

George Williams
In reply to this post by George Williams
On Sat, 2005-06-11 at 20:27, George Williams wrote:
> > Can reencoding succeed when all glyph names are
> > "uni<hex><hex><hex><hex>" or "uni<hex><hex><hex><hex><hex>?"
> Yes. Though the recommended syntax is "u<hex><hex><hex><hex><hex>" for
> the second form.
Oops. Sorry. I realize this question is more complicated than I first
thought. The real answer is "It depends"

It depends on how you define your encoding. If you define your encoding
using glyph names, then yes the glyph names must match exactly. If you
define your encoding by unicode code points then the code points must
match.



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
Reply | Threaded
Open this post in threaded view
|

Re: No selection

Peter Dyballa
In reply to this post by George Williams

Am 12.06.2005 um 05:27 schrieb George Williams:

> Reencode("TeX8r")
>

Is Fontforge's built-in 8r encoding up-to-date? Last autumn -- ahemm,
autumn 2002 a change happened, some MacRoman glyphs were incorporated,
but not all maintainers of the TeX fragments did update. The correct
version is here: http://tug.org/fontname/8r.enc.

How can I teach Fontforge my "8p" encoding? This way:

        LoadEncodingFile("8p.enc")
        Reencode("TeXTextExtrasEncoding")

because the encoding file starts with

        %!PS-Adobe-3.0 Resource-Encoding
        % @psencodingfile{
        ...
        %%BeginResource: encoding TeXTextExtrasEncoding
        /TeXTextExtrasEncoding [
        % 0
        /.notdef
        /Gamma
        /Theta
        ...
        /Germandblssmall
        ] def
        %%EndResource
       
        % End of file 8p.enc.


And the TT glyph names are usually not the same as the PS glyph names,
which made me write a Perl script to change the glyph names in the AFM
files ttf2pt1 produced so that fontinst sees the proper names ...

--
Greetings

   Pete

"A mathematician is a machine that turns coffee into theorems."



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users