Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

File asscociation

Jun
223
0
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?
 
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]`
 
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
 

Similar threads

Back
Top