1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

File asscociation

Discussion in 'Support' started by nickles, Mar 9, 2013.

  1. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    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?
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    How about:
    Code:
    set .ttf=`fontview.exe %@unquote[%1]`
    
     
  3. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    Hi Charles,

    thanks for pointing me at the unquote[] function; alas, it's not working...
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,277
    Likes Received:
    38
    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
    
     
  5. nickles

    Joined:
    Jun 24, 2008
    Messages:
    220
    Likes Received:
    0
    That does it... Thanks a lot!
     

Share This Page