I think in your case, your example should already work, but this thread has 
inspired me to add a couple more options for controlling how fonts are found:
https://github.com/OpenImageIO/oiio/pull/3096

With this change, you can set $OPENIMAGEIO_FONTS to a colon (or semicolon) 
separated searchpath, and also for apps directly calling 
ImageBufAlgo::render_text, you can also OIIO::attribute("font_searchpath", ...).



> On Sep 14, 2021, at 10:36 AM, Larry Gritz <l...@larrygritz.com> wrote:
> 
> c:\Windows\Fonts is already a place where it will search.
> 
> https://github.com/OpenImageIO/oiio/blob/master/src/libOpenImageIO/imagebufalgo_draw.cpp#L724
>  
> <https://github.com/OpenImageIO/oiio/blob/master/src/libOpenImageIO/imagebufalgo_draw.cpp#L724>
> 
> You can see here all the directories that it will search for fonts. There are 
> a whole lot of standard areas on different systems.
> 
>       -- lg
> 
> 
>> On Sep 14, 2021, at 10:12 AM, Phil Miller <philip.mil...@sri.com 
>> <mailto:philip.mil...@sri.com>> wrote:
>> 
>> If your working directory is somewhere on c:\, then you should be able to use
>>  
>>                 --text:font=/Windows/Fonts/Arial.tff
>>  
>> And then, if necessary, use absolute paths to the input and output files.
>>  
>>  
>> From: Oiio-dev <oiio-dev-boun...@lists.openimageio.org 
>> <mailto:oiio-dev-boun...@lists.openimageio.org>> On Behalf Of Larry Gritz
>> Sent: Tuesday, September 14, 2021 1:00 PM
>> To: OpenImageIO dev list <oiio-dev@lists.openimageio.org 
>> <mailto:oiio-dev@lists.openimageio.org>>
>> Subject: [EXTERNAL] Re: [Oiio-dev] oiiotool --text:font
>>  
>> Oh boy, that's tricky. The ':' separates options, but in this case, it's 
>> part of the filename.
>>  
>> By any chance, does this work?
>>  
>>                 --text:font=/C/Windows/Fonts/Arial.tff
>>  
>> ??
>>  
>> If not, I'll brew something up for you to fix. This is an unintended 
>> limitation.
>>  
>> 
>> 
>> On Sep 14, 2021, at 8:57 AM, Steven Caron <car...@gmail.com 
>> <mailto:car...@gmail.com>> wrote:
>>  
>> Hi Again!
>> 
>> I can't seem to set the font option of the --text command. It doesn't seem 
>> to like my windows drive syntax with a colon. I think the parser is 
>> expecting another option/modifier. Example...
>> 
>> oiiotool in.exr --text:font=C:/Windows/Fonts/Arial.ttf test -o out.exr
>> oiiotool ERROR: text : Could not set font face to "C"
>> 
>> I tried wrapping the path in quotes without luck.
>>  
>> Thanks,
>> Steven
>> _______________________________________________
>> Oiio-dev mailing list
>> Oiio-dev@lists.openimageio.org <mailto:Oiio-dev@lists.openimageio.org>
>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org 
>> <https://urldefense.us/v3/__http:/lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org__;!!Nv3xtKNH_4uope0!zEO8OPcqEzqaREZRdZQLoGkJ5vEsjz9Qw1QNHFKGC3PAlFY4_YT99oUZs2lqBKdD$>
>>  
>> --
>> Larry Gritz
>> l...@larrygritz.com <mailto:l...@larrygritz.com>
>>  
>>  
>>  
>>  
>> _______________________________________________
>> Oiio-dev mailing list
>> Oiio-dev@lists.openimageio.org <mailto:Oiio-dev@lists.openimageio.org>
>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org 
>> <http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org>
> --
> Larry Gritz
> l...@larrygritz.com <mailto:l...@larrygritz.com>
> 
> 
> 
> 
> _______________________________________________
> Oiio-dev mailing list
> Oiio-dev@lists.openimageio.org
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

--
Larry Gritz
l...@larrygritz.com




_______________________________________________
Oiio-dev mailing list
Oiio-dev@lists.openimageio.org
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to