[Python] Search for Characters by Font Name
Posted: Fri Apr 11, 2008 11:16 pm
Hello,
I am in the process of writing a script which needs to perform a search and replace on a number of characters in a specified font; I essentially need to be able to say "for all 'a's in 'Some Greek Font' font, replace them with unicode 'α's of another font", for example.
I have all of this working, with the exception of searching for characters ONLY in a specific font. I have tried including in the search attributes the "CharFontName" property name set to be equal to the name of the font I am looking for, but then OOo fails to perform any replacements at all. On the other hand, if I do not set this property, it will replace all "a"s in the document, as expected, regardless of what font they are in. I was just wondering if I were missing something, or doing something incorrectly.
Thanks for any help!
I am in the process of writing a script which needs to perform a search and replace on a number of characters in a specified font; I essentially need to be able to say "for all 'a's in 'Some Greek Font' font, replace them with unicode 'α's of another font", for example.
I have all of this working, with the exception of searching for characters ONLY in a specific font. I have tried including in the search attributes the "CharFontName" property name set to be equal to the name of the font I am looking for, but then OOo fails to perform any replacements at all. On the other hand, if I do not set this property, it will replace all "a"s in the document, as expected, regardless of what font they are in. I was just wondering if I were missing something, or doing something incorrectly.
Thanks for any help!