File asscociation

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#1
fontview is the Windows Font viewer; it doesn't like dquotes:

fontview "osaka-sans serif.ttf" will result in an error ("invalid font file") message while
fontview osaka-san serif.ttf (mind the unquoted space) will not.

I'd like to setup a file assciation mapping that strips any - automatically added (e.g. through command line expansion) - dquotes from the file name before submitting it to fontview.

So far:

a) set .ttf=fontview.exe => dquotes are not stripped (obviously) => error (works however with unquoted names like e.g. arial.ttf)

b) set .ttf=`%@strip[^^",%1]` => error (*)

c) function stripdq=`%strip[^^",%1]` (*)
set .ttf=`stripdq[%1]`

(*) Strange enough, typing the first letter ("0") of the font name expands the file name; hence tcc is able to deduct that the font file is a TTF file to apply the .ttf= setting to.

Any hints?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,385
39
Albuquerque, NM
prospero.unm.edu
#2
fontview is the Windows Font viewer; it doesn't like dquotes:

fontview "osaka-sans serif.ttf" will result in an error ("invalid font file") message while
fontview osaka-san serif.ttf (mind the unquoted space) will not.

I'd like to setup a file assciation mapping that strips any - automatically added (e.g. through command line expansion) - dquotes from the file name before submitting it to fontview.

So far:

a) set .ttf=fontview.exe => dquotes are not stripped (obviously) => error (works however with unquoted names like e.g. arial.ttf)

b) set .ttf=`%@strip[^^",%1]` => error (*)

c) function stripdq=`%strip[^^",%1]` (*)
set .ttf=`stripdq[%1]`
How about:
Code:
set .ttf=`fontview.exe %@unquote[%1]`
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,385
39
Albuquerque, NM
prospero.unm.edu
#4
Hi Charles,

thanks for pointing me at the unquote[] function; alas, it's not working...
I see. But I don't understand; looks like we're bumping into some parser feature which I just don't get.

Perhaps the best approach is simply to fix the FONTVIEW command:

Code:
alias fontview=`fontview.exe %@unquotes[%1]`
set .ttf=fontview