[GRASS-dev] problems with mkftcap

I just updated, did a make distclean, and recompiled GRASS 6.3.

mkftcap is not working on my Mac Intel MacBook Pro (OS X 4.9)

When I compiled, there was an error in compiling mkftcap. I changed to the mkftcap directory and ran make and it compiled without apparent error. But when I try to run it, I get an error. I list all below. My freetypecap file is empty.

Michael

***************************ORIGINAL ERROR WITH MAKE

mkftcap
if [ ! -d /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/scripts ]; then mkdir /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/scripts; fi
/usr/bin/install -c mkftcap /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/scripts/mkftcap
GISRC=/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/demolocation/.grassrc63 GISBASE=/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1 PATH=“/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/bin:$PATH” DYLD_LIBRARY_PATH=“/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/bin:/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/lib:” LC_ALL=C /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/scripts/mkftcap --html-description | grep -v ‘|’ > mkftcap.tmp.html ; true
find: -printf: unknown expression primary
find: -printf: unknown expression primary
find: -printf: unknown expression primary
find: -printf: unknown expression primary
mkdir -p /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/docs/html
mv -f mkftcap.tmp.html /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/docs/html/mkftcap.html
for file in *.png .jpg ; do
head -n 1 $file | grep ‘^#!’ > /dev/null ;
if [ $? -ne 0 ] ; then
/usr/bin/install -c -m 644 $file /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/docs/html ;
fi
done 2> /dev/null ; true
GISRC=/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/demolocation/.grassrc63 GISBASE=/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1 PATH=/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/bin:$PATH DYLD_LIBRARY_PATH=“/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/lib:” g.parser -t mkftcap | sed s/"/\\"/g | sed 's/.
/_(“&”)/’ > …/…/locale/scriptstrings/mkftcap_to_translate.c ; true
/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/scripts/mkftcap > /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/etc/freetypecap
You must be in GRASS GIS to run this program
make[2]: *** [/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/etc/freetypecap] Error 1

***************************RESULTS AFTER RUNING MAKE IN THE MKFTCAP DIRECTORY

cmb-MBP:~/grass_dev/grass6 cmbarton$ cd ./tools/mkftcap
cmb-MBP:~/grass_dev/grass6/tools/mkftcap cmbarton$ make
GISRC=/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/demolocation/.grassrc63 GISBASE=/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1 PATH=“/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/bin:$PATH” DYLD_LIBRARY_PATH=“/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/bin:/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/lib:” LC_ALL=C /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/scripts/mkftcap --html-description | grep -v ‘|’ > mkftcap.tmp.html ; true
find: -printf: unknown expression primary
find: -printf: unknown expression primary
find: -printf: unknown expression primary
find: -printf: unknown expression primary
mkdir -p /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/docs/html
mv -f mkftcap.tmp.html /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/docs/html/mkftcap.html
for file in *.png .jpg ; do
head -n 1 $file | grep ‘^#!’ > /dev/null ;
if [ $? -ne 0 ] ; then
/usr/bin/install -c -m 644 $file /Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/docs/html ;
fi
done 2> /dev/null ; true
GISRC=/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/demolocation/.grassrc63 GISBASE=/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1 PATH=/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/bin:$PATH DYLD_LIBRARY_PATH=“/Users/cmbarton/grass_dev/grass6/dist.i686-apple-darwin8.9.1/lib:” g.parser -t mkftcap | sed s/"/\\"/g | sed 's/.
/_(“&”)/’ > …/…/locale/scriptstrings/mkftcap_to_translate.c ; true

***************************ERROR ON RUNING MKFTCAP

GRASS 6.3.cvs (spearfish60_test):~ > mkftcap
find: -printf: unknown expression primary
find: -printf: unknown expression primary
find: -printf: unknown expression primary
find: -printf: unknown expression primary


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

Michael Barton wrote:

I just updated, did a make distclean, and recompiled GRASS 6.3.

mkftcap is not working on my Mac Intel MacBook Pro (OS X 4.9)

When I compiled, there was an error in compiling mkftcap. I changed to the
mkftcap directory and ran make and it compiled without apparent error. But
when I try to run it, I get an error. I list all below. My freetypecap file
is empty.

mkftcap is just a script.

GRASS 6.3.cvs (spearfish60_test):~ > mkftcap
find: -printf: unknown expression primary
find: -printf: unknown expression primary
find: -printf: unknown expression primary
find: -printf: unknown expression primary

The command in question is:

  find "$dir" -type f -iname '*.ttf' -printf '%f:%p:utf-8:\n'

Does OSX have a command called "find" which isn't the standard Unix
"find" command?

--
Glynn Clements <glynn@gclements.plus.com>

I *thought* it was a script, which is why my results seemed very strange.

On 5/2/07 12:02 AM, "Glynn Clements" <glynn@gclements.plus.com> wrote:

The command in question is:

find "$dir" -type f -iname '*.ttf' -printf '%f:%p:utf-8:\n'

Does OSX have a command called "find" which isn't the standard Unix
"find" command?

find
usage: find [-H | -L | -P] [-EXdsx] [-f file] [file ...] [expression]

Is this different from the standard?

Michael

__________________________________________
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

Michael Barton wrote:

> The command in question is:
>
> find "$dir" -type f -iname '*.ttf' -printf '%f:%p:utf-8:\n'
>
> Does OSX have a command called "find" which isn't the standard Unix
> "find" command?
>
find
usage: find [-H | -L | -P] [-EXdsx] [-f file] [file ...] [expression]

Is this different from the standard?

No, that's the right command; it appears -printf is a GNU extension.

That shouldn't be a problem in this case; using:

  find "$dir" -type f -iname '*.ttf' -print | sed 's!^\(.*\)/\(.*\)$!\2:\1/\2:utf-8:!'

should do the same job.

--
Glynn Clements <glynn@gclements.plus.com>

I just updated. Works great. Thanks.

I'll move ahead on building a listbox control in wxPython that will use
this.

Michael

On 5/2/07 1:00 AM, "Glynn Clements" <glynn@gclements.plus.com> wrote:

Michael Barton wrote:

The command in question is:

find "$dir" -type f -iname '*.ttf' -printf '%f:%p:utf-8:\n'

Does OSX have a command called "find" which isn't the standard Unix
"find" command?

find
usage: find [-H | -L | -P] [-EXdsx] [-f file] [file ...] [expression]

Is this different from the standard?

No, that's the right command; it appears -printf is a GNU extension.

That shouldn't be a problem in this case; using:

find "$dir" -type f -iname '*.ttf' -print | sed
's!^\(.*\)/\(.*\)$!\2:\1/\2:utf-8:!'

should do the same job.

__________________________________________
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

I'm having a different problem with mkftcap - it's getting hung up doing nothing. One on my processors maxes out and there is no disk activity for the find operations.

I tried cutting out each part separately - find and fc-list - to see if one of those was the problem, but no go.

Further cutting points to something wrong in the sed lines - if I remove those so the raw find and fc-list results are returned, it finishes.

On May 2, 2007, at 3:00 AM, Glynn Clements wrote:

Michael Barton wrote:

The command in question is:

find "$dir" -type f -iname '*.ttf' -printf '%f:%p:utf-8:\n'

Does OSX have a command called "find" which isn't the standard Unix
"find" command?

find
usage: find [-H | -L | -P] [-EXdsx] [-f file] [file ...] [expression]

Is this different from the standard?

No, that's the right command; it appears -printf is a GNU extension.

That shouldn't be a problem in this case; using:

  find "$dir" -type f -iname '*.ttf' -print | sed 's!^\(.*\)/\(.*\)$!\2:\1/\2:utf-8:!'

should do the same job.

--
Glynn Clements <glynn@gclements.plus.com>

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

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

First Pogril: Why is life like sticking your head in a bucket filled with hyena offal?
Second Pogril: I don't know. Why IS life like sticking your head in a bucket filled with hyena offal?
First Pogril: I don't know either. Wretched, isn't it?

-HitchHiker's Guide to the Galaxy

In fact, I was too hasty in my optimistic report. mkftcap works, but it
doesn't put the output into my $GISBASE/etc/freetypecap file. It just
outputs it to the terminal. I can manually deal with this

mkftcap>$GISBASE/etc/freetypecap

but something is not working right. Maybe need to recompile.

Michael

On 5/2/07 8:41 AM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

I'm having a different problem with mkftcap - it's getting hung up
doing nothing. One on my processors maxes out and there is no disk
activity for the find operations.

I tried cutting out each part separately - find and fc-list - to see
if one of those was the problem, but no go.

Further cutting points to something wrong in the sed lines - if I
remove those so the raw find and fc-list results are returned, it
finishes.

On May 2, 2007, at 3:00 AM, Glynn Clements wrote:

Michael Barton wrote:

The command in question is:

find "$dir" -type f -iname '*.ttf' -printf '%f:%p:utf-8:\n'

Does OSX have a command called "find" which isn't the standard Unix
"find" command?

find
usage: find [-H | -L | -P] [-EXdsx] [-f file] [file ...] [expression]

Is this different from the standard?

No, that's the right command; it appears -printf is a GNU extension.

That shouldn't be a problem in this case; using:

find "$dir" -type f -iname '*.ttf' -print | sed 's!^\(.*\)/\(.*\)$!
\2:\1/\2:utf-8:!'

should do the same job.

--
Glynn Clements <glynn@gclements.plus.com>

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

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

First Pogril: Why is life like sticking your head in a bucket filled
with hyena offal?
Second Pogril: I don't know. Why IS life like sticking your head in
a bucket filled with hyena offal?
First Pogril: I don't know either. Wretched, isn't it?

-HitchHiker's Guide to the Galaxy

__________________________________________
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

On May 2, 2007, at 10:41 AM, William Kyngesburye wrote:

I'm having a different problem with mkftcap - it's getting hung up doing nothing. One on my processors maxes out and there is no disk activity for the find operations.

I tried cutting out each part separately - find and fc-list - to see if one of those was the problem, but no go.

Further cutting points to something wrong in the sed lines - if I remove those so the raw find and fc-list results are returned, it finishes.

I found the source of my problem - in my .bash_profile, I set:

export LC_CTYPE="en_US.UTF-8"
export LANG="en_US.UTF-8"

if I unset both, mkftcap works. I also have:

set dspmbyte = \"utf8\"

but I don't need to change that for mkftcap to work.

I set these (maybe naively?) so my Terminals match the default OSX charset of utf8. The window display settings for Terminal.app default to utf8 (and I didn't need to change that either).

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

"Mon Dieu! but they are all alike. Cheating, murdering, lying, fighting, and all for things that the beasts of the jungle would not deign to possess - money to purchase the effeminate pleasures of weaklings. And yet withal bound down by silly customs that make them slaves to their unhappy lot while firm in the belief that they be the lords of creation enjoying the only real pleasures of existence....

- the wisdom of Tarzan

Sorry, responding to myself again...

On May 2, 2007, at 2:11 PM, William Kyngesburye wrote:

On May 2, 2007, at 10:41 AM, William Kyngesburye wrote:

I'm having a different problem with mkftcap - it's getting hung up doing nothing. One on my processors maxes out and there is no disk activity for the find operations.

I tried cutting out each part separately - find and fc-list - to see if one of those was the problem, but no go.

Further cutting points to something wrong in the sed lines - if I remove those so the raw find and fc-list results are returned, it finishes.

I found the source of my problem - in my .bash_profile, I set:

export LC_CTYPE="en_US.UTF-8"
export LANG="en_US.UTF-8"

if I unset both, mkftcap works. I also have:

set dspmbyte = \"utf8\"

but I don't need to change that for mkftcap to work.

I set these (maybe naively?) so my Terminals match the default OSX charset of utf8. The window display settings for Terminal.app default to utf8 (and I didn't need to change that either).

After trying various combinations of these settings, it appears I don't need these any more. They are probably leftovers in my .bash_profile from the early OSX days when Terminal didn't handle UTF8 directly very well. It looks like the window setting takes care of this now.

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

All generalizations are dangerous, even this one.

Michael Barton wrote:

In fact, I was too hasty in my optimistic report. mkftcap works, but it
doesn't put the output into my $GISBASE/etc/freetypecap file. It just
outputs it to the terminal. I can manually deal with this

mkftcap>$GISBASE/etc/freetypecap

but something is not working right. Maybe need to recompile.

It is meant to write to stdout; it originally wrote directly to the
freetypecap file, but was changed to improve flexibility.

--
Glynn Clements <glynn@gclements.plus.com>

In that case it is working correctly.

Michael

On 5/2/07 4:59 PM, "Glynn Clements" <glynn@gclements.plus.com> wrote:

Michael Barton wrote:

In fact, I was too hasty in my optimistic report. mkftcap works, but it
doesn't put the output into my $GISBASE/etc/freetypecap file. It just
outputs it to the terminal. I can manually deal with this

mkftcap>$GISBASE/etc/freetypecap

but something is not working right. Maybe need to recompile.

It is meant to write to stdout; it originally wrote directly to the
freetypecap file, but was changed to improve flexibility.

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

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

more trouble...

Now that mkftcap is not hanging for me, next problem. For some reason the resource fonts are getting filtered out.

The first part, listing ttf, seems to be working. The fc-list part should work - alone, the fc-list :outline file index command shows all the fonts. But after the sed, they're gone. Could it be because they don't have a file extension?

Here's a small clip of the raw fc-list output:

/System/Library/Fonts/Times.dfont: :index=0
/Library/Fonts/Arial Narrow: :index=0
/System/Library/Fonts/ヒラギノ角ゴ Std W8.otf: :index=0
/System/Library/Fonts/Apple LiGothic Medium.dfont: :index=0
/Library/Fonts/Arial Rounded Bold: :index=0
/Library/Fonts/Times New Roman: :index=0
/Library/Fonts/Andale Mono: :index=0
/System/Library/Fonts/ZapfDingbats.dfont: :index=0
/System/Library/Fonts/Hei.dfont: :index=0

Arial Narrow, Arial Rounded Bold, Times New Roman and Andale Mono disappear after the sed.

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

"History is an illusion caused by the passage of time, and time is an illusion caused by the passage of history."

- Hitchhiker's Guide to the Galaxy

William Kyngesburye wrote:

Here's a small clip of the raw fc-list output:

/System/Library/Fonts/Times.dfont: :index=0
/Library/Fonts/Arial Narrow: :index=0
/System/Library/Fonts/ヒラギノ角ゴ Std W8.otf: :index=0
/System/Library/Fonts/Apple LiGothic Medium.dfont: :index=0
/Library/Fonts/Arial Rounded Bold: :index=0
/Library/Fonts/Times New Roman: :index=0
/Library/Fonts/Andale Mono: :index=0
/System/Library/Fonts/ZapfDingbats.dfont: :index=0
/System/Library/Fonts/Hei.dfont: :index=0

Arial Narrow, Arial Rounded Bold, Times New Roman and Andale Mono
disappear after the sed.

replace spaces in font names with underscores?

Hamish

On May 2, 2007, at 8:17 PM, Hamish wrote:

William Kyngesburye wrote:

Here's a small clip of the raw fc-list output:

/System/Library/Fonts/Times.dfont: :index=0
/Library/Fonts/Arial Narrow: :index=0
/System/Library/Fonts/ヒラ゠゙ノ角ゴ Std W8.otf: :index=0
/System/Library/Fonts/Apple LiGothic Medium.dfont: :index=0
/Library/Fonts/Arial Rounded Bold: :index=0
/Library/Fonts/Times New Roman: :index=0
/Library/Fonts/Andale Mono: :index=0
/System/Library/Fonts/ZapfDingbats.dfont: :index=0
/System/Library/Fonts/Hei.dfont: :index=0

Arial Narrow, Arial Rounded Bold, Times New Roman and Andale Mono
disappear after the sed.

replace spaces in font names with underscores?

Not a good idea - if you mean renaming the font files. These are standard fonts supplied with OSX. Renaming them can create possible OS update problems.

If I take enough time to let my brain process the sed command, it looks like it's something in:

\(.*\)\.\([^.]*\):

that is, the file extension is not optional. Spaces are OK in that.

-----
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

On 5/2/07, William Kyngesburye <woklist@kyngchaos.com> wrote:
[...]

If I take enough time to let my brain process the sed command, it
looks like it's something in:

\(.*\)\.\([^.]*\):

that is, the file extension is not optional. Spaces are OK in that.

Try \(.*\)(\.\([^.]*\))?: instead.

Daniel.

--
-- Daniel Calvelo Aros

Daniel Calvelo wrote:

> If I take enough time to let my brain process the sed command, it
> looks like it's something in:
>
> \(.*\)\.\([^.]*\):
>
> that is, the file extension is not optional. Spaces are OK in that.

Try \(.*\)(\.\([^.]*\))?: instead.

A ? in a sed regexp is a GNU extension.

I've updated mkftcap to handle files without an extension separately:

        fc-list :outline file index \
            | sed -n \
                  -e 's!^\(.*\)/\(.*\)\.\([^.]*\): :index=0$!\2:\1/\2.\3:utf-8:!p' \
                  -e 's!^\(.*\)/\(.*\)\.\([^.]*\): :index=\([0-9]\+\)$!\2:\1/\2.\3|\4:utf-8:!p' \
                  -e 's!^\(.*\)/\(.*\): :index=0$!\2:\1/\2:utf-8:!p' \
                  -e 's!^\(.*\)/\(.*\): :index=\([0-9]\+\)$!\2:\1/\2|\3:utf-8:!p'

--
Glynn Clements <glynn@gclements.plus.com>

That works. (still a minor problem with Arial, but not the other Arial varieties, it's probably a corrupt font file or other non-fontconfig/grass issue)

One note - did you catch my other comment a while back? the index from fc-list is useless, since fc-list appears to only list font files, thus only showing index 0 for any font file. We'll have to find another way to figure out available faces within a font file.

On May 2, 2007, at 11:28 PM, Glynn Clements wrote:

Daniel Calvelo wrote:

If I take enough time to let my brain process the sed command, it
looks like it's something in:

\(.*\)\.\([^.]*\):

that is, the file extension is not optional. Spaces are OK in that.

Try \(.*\)(\.\([^.]*\))?: instead.

A ? in a sed regexp is a GNU extension.

I've updated mkftcap to handle files without an extension separately:

        fc-list :outline file index \
            | sed -n \
                  -e 's!^\(.*\)/\(.*\)\.\([^.]*\): :index=0$!\2:\1/\2.\3:utf-8:!p' \
                  -e 's!^\(.*\)/\(.*\)\.\([^.]*\): :index=\([0-9]\+\)$!\2:\1/\2.\3|\4:utf-8:!p' \
                  -e 's!^\(.*\)/\(.*\): :index=0$!\2:\1/\2:utf-8:!p' \
                  -e 's!^\(.*\)/\(.*\): :index=\([0-9]\+\)$!\2:\1/\2|\3:utf-8:!p'

--
Glynn Clements <glynn@gclements.plus.com>

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

First Pogril: Why is life like sticking your head in a bucket filled with hyena offal?
Second Pogril: I don't know. Why IS life like sticking your head in a bucket filled with hyena offal?
First Pogril: I don't know either. Wretched, isn't it?

-HitchHiker's Guide to the Galaxy