2009/12/20 Jean-Baptiste Faure <[email protected]>:
> Le 20.12.2009 12:35, Johnny Rosenberg a écrit :
>> I have an ODT that is a mess. Originally I used Arial and Courier New
>> as the two main fonts in it, but since I found that FreeSans and
>> FreeMono are more suitable for me, I changed all styles that I use in
>> the document to the new fonts. However, some sentences are a mix of
>> the two fonts and here and there the old fonts are present. Since this
>> is a real mess, it would take very long time to correct. I figured out
>> how to search for a font, but not how to replace it with another one.
>>
>> So what I did was to unzip the document and replace the fonts using a
>> text editor (gedit) instead. I zipped it again and renamed it to
>> Filename.odt. Unfortunately I can not open the document anymore.
>> OpenOffice.org Writer says that the document is corrupt…
>>
>> This is only a copy of the original document, so I still have the
>> original document, so that's not a problem. What I want to know now is
>> if anyone have a better idea how to do this. If using a text editor,
>> in which ones of the all xml files can I search and replace font
>> names, and which ones should I leave as is?
>>
>> I did a search and replace in every xml file in which I could find the
>> word ”Arial” and/or ”Courier New”, but that was obviously not optimal…
>>
>> As I said, I always do this kind of stuff on a copy of the original
>> file, so I can be quite experimental without losing anything.
>>
>> Johnny Rosenberg
>>
>>
>>
> Hi Johnny,
>
> You can do that with Altsearch extension :
> http://extensions.services.openoffice.org/project/AltSearch
Thanks. Going to check it out.
>
> If you want replace Arial font by DejaVu Serif font, set the following
> fields:
> Find field : [:::CharFontName=Arial::]
> Replace field : \A{CharFontName=DejaVu Serif}
> check "Regular expressions"
DejaVu fonts are too wide for my taste, but I understand what you
mean. What's the ”\A” for?
>
> On the other hand, if you do not have to preserve some different font
> definition, you can select the whole text, then right click and choose
> default formatting.
Well, my document is mainly a mix of two fonts: Arial and Courier New.
Arial for explaining text and Courier New for code and commands. I
have replaced Arial by FreeSans and Courier New by FreeMono, but there
are still fragments of text with at least the Arial font, so I can't
select all and select FreeSans for everything, because that means that
I have a lot of work to do to manually change many parts of the text
to FreeMono.
>
> Regards
> JBF
>
Thanks,
Johnny Rosenberg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]