[Python] Search for Characters by Font Name

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
philfazio
Posts: 1
Joined: Fri Apr 11, 2008 11:00 pm

[Python] Search for Characters by Font Name

Post by philfazio »

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!
B Marcelly
Volunteer
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: [Python] Search for Characters by Font Name

Post by B Marcelly »

Hi,
philfazio wrote:I was just wondering if I were missing something, or doing something incorrectly.
How could we correct your code if you don't show it ?
______
Bernard
Post Reply