[GRASS-dev] the other part of font face index support

Aside from getting the face index to a font file to work for fonts with multiple styles in one file, the other problem is listing those indexes and matching them with actual styles, or face names. This is needed because there is no guarantee of the order of the faces in the file - regular is not always 0, bold not always 1, ...

As an example, when I set the font to Arial Narrow, which has the usual assortment of regular, italic, bold and bold-italic in a single file, without an index (which defaults to 0), FreeType displays Arial Narrow Italic.

fc-list appears to only list files. The index info is always 0, and so is useless. OSX has an older FontConfig (I couldn't figure out which version, since the library version doesn't seem to correspond to the package version), so maybe the latest FC will list all font faces in font files? Not that that will be any use if we want to minimize necessity for replacing/updating what is supplied by the OS.

I worked out an AppleScript to get font info from the OSX Font Book.app, but it has no concept of indexes of faces in files, just names. But at least I got ALL faces in the font files, and their paths.

I thought in FreeType you could open a face by style name, but waht little I could understand from the FT API docs all points to just indexes. Maybe there is a get font info function that can be used to somehow return names of all face indexes in a font file?

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

[Trillian] What are you supposed to do WITH a maniacally depressed robot?

[Marvin] You think you have problems? What are you supposed to do if you ARE a maniacally depressed robot? No, don't try and answer, I'm 50,000 times more intelligent than you and even I don't know the answer...

- HitchHiker's Guide to the Galaxy

Perhaps the ftinfo tool can help you find more things about the font?

ftinfo -a fontfile will give you a lot of data :slight_smile:

--Wolf

On 04.05.2007 06:08, William Kyngesburye wrote:

Aside from getting the face index to a font file to work for fonts with
multiple styles in one file, the other problem is listing those indexes
and matching them with actual styles, or face names. This is needed
because there is no guarantee of the order of the faces in the file -
regular is not always 0, bold not always 1, ...

As an example, when I set the font to Arial Narrow, which has the usual
assortment of regular, italic, bold and bold-italic in a single file,
without an index (which defaults to 0), FreeType displays Arial Narrow
Italic.

fc-list appears to only list files. The index info is always 0, and so
is useless. OSX has an older FontConfig (I couldn't figure out which
version, since the library version doesn't seem to correspond to the
package version), so maybe the latest FC will list all font faces in
font files? Not that that will be any use if we want to minimize
necessity for replacing/updating what is supplied by the OS.

I worked out an AppleScript to get font info from the OSX Font Book.app,
but it has no concept of indexes of faces in files, just names. But at
least I got ALL faces in the font files, and their paths.

I thought in FreeType you could open a face by style name, but waht
little I could understand from the FT API docs all points to just
indexes. Maybe there is a get font info function that can be used to
somehow return names of all face indexes in a font file?

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

[Trillian] What are you supposed to do WITH a maniacally depressed robot?

[Marvin] You think you have problems? What are you supposed to do if
you ARE a maniacally depressed robot? No, don't try and answer, I'm
50,000 times more intelligent than you and even I don't know the answer...

- HitchHiker's Guide to the Galaxy

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

--

<:3 )---- Wolf Bergenheim ----( 8:>

This is not installed on my Mac, although I have installed X11 and a bunch
of other stuff.

Michael

On 5/3/07 10:30 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

Perhaps the ftinfo tool can help you find more things about the font?

ftinfo -a fontfile will give you a lot of data :slight_smile:

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Ah. it is part of the fttools package on Debian. Well I guess one (I)
could make a similar utility to ship with GRASS...

--Wolf

On 04.05.2007 08:52, Michael Barton wrote:

This is not installed on my Mac, although I have installed X11 and a bunch
of other stuff.

Michael

On 5/3/07 10:30 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

Perhaps the ftinfo tool can help you find more things about the font?

ftinfo -a fontfile will give you a lot of data :slight_smile:

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

--

<:3 )---- Wolf Bergenheim ----( 8:>

I guess I didn't finish my thoughts in my email (oops)...

- Add some utility to retrieve font info using FT functions - either an etc/ tool or a module (ie d.freetype.info). mkftcap would step thru each font file in the initial list and see if it has multiple faces, building a new more complete freetypecap list.

It could even be used in place of fc-list, since mkftcap checks the usual dirs anyways, and can check dirs passed to it. Instead of finding specific extensions, get the font info on every file, and if it's not a font file, no info will be returned. Unusable fonts, like PCF, can still be detected and skipped.

If you can write a simple utility like this, go for it. And it would be much more dependable than using fc-list IF it's installed, or requiring yet another external package to be installed, since it would be a part of GRASS.

On May 4, 2007, at 1:36 AM, Wolf Bergenheim wrote:

Ah. it is part of the fttools package on Debian. Well I guess one (I)
could make a similar utility to ship with GRASS...

--Wolf

On 04.05.2007 08:52, Michael Barton wrote:

This is not installed on my Mac, although I have installed X11 and a bunch
of other stuff.

Michael

On 5/3/07 10:30 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

Perhaps the ftinfo tool can help you find more things about the font?

ftinfo -a fontfile will give you a lot of data :slight_smile:

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"This is a question about the past, is it? ... How can I tell that the past isn't a fiction designed to account for the discrepancy between my immediate physical sensations and my state of mind?"

- The Ruler of the Universe

I'm willing to do this, but can you wait a week? I have 2 exams 3
project deadlines and a work deadline all by next week. So you can guess
how many minutes I can spend on GRASS the next week... :frowning:

--Wolf

On 04.05.2007 17:23, William Kyngesburye wrote:

I guess I didn't finish my thoughts in my email (oops)...

- Add some utility to retrieve font info using FT functions - either an
etc/ tool or a module (ie d.freetype.info). mkftcap would step thru
each font file in the initial list and see if it has multiple faces,
building a new more complete freetypecap list.

It could even be used in place of fc-list, since mkftcap checks the
usual dirs anyways, and can check dirs passed to it. Instead of finding
specific extensions, get the font info on every file, and if it's not a
font file, no info will be returned. Unusable fonts, like PCF, can
still be detected and skipped.

If you can write a simple utility like this, go for it. And it would be
much more dependable than using fc-list IF it's installed, or requiring
yet another external package to be installed, since it would be a part
of GRASS.

On May 4, 2007, at 1:36 AM, Wolf Bergenheim wrote:

Ah. it is part of the fttools package on Debian. Well I guess one (I)
could make a similar utility to ship with GRASS...

--Wolf

On 04.05.2007 08:52, Michael Barton wrote:

This is not installed on my Mac, although I have installed X11 and a
bunch
of other stuff.

Michael

On 5/3/07 10:30 PM, "Wolf Bergenheim" <wolf+grass@bergenheim.net> wrote:

Perhaps the ftinfo tool can help you find more things about the font?

ftinfo -a fontfile will give you a lot of data :slight_smile:

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"This is a question about the past, is it? ... How can I tell that the
past isn't a fiction designed to account for the discrepancy between my
immediate physical sensations and my state of mind?"

- The Ruler of the Universe

--

<:3 )---- Wolf Bergenheim ----( 8:>