changing document font without changing symbol font

Discuss the word processor
Post Reply
mad_pear
Posts: 1
Joined: Thu Jan 03, 2008 3:09 am

changing document font without changing symbol font

Post by mad_pear »

Hi all,
Sorry if this is a stupid question, but I use a lot of symbols (e.g. Greek letters) in my documents. I have been inserting them either by typing in letters, selecting them, and then selecting the "Standard Symbols L" font or by going to Insert/Special Characters and choosing "Standard Symbols L" from the drop down menu and choosing my symbol. My normal text font is "Numbus Roman No9 L". Okay, so I have all these symbols throughout the document. How do I change the Nimbus font to something else without changing the symbols font? Maybe this is impossible the way I've inserted the symbols; if so, that's fine, but how would I set it up in the future so I can change the Nimbus font without changing the symbols. Thanks.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: changing document font without changing symbol font

Post by acknak »

You're using the "old way" of inserting symbols. It still works, and you can use it if you want, but it's not the best approach.

If you just want to keep what you already have, I suggest you convert your symbols to use a specific character style instead of just a direct font change. You can use Edit > Find & Replace to select all the instances using your symbol font, then apply a character style to them. You can define the style to use your symbol font and you're set. Changing the text font won't remove the character style.

The problem with that method is that it depends on the specific symbol font. Not all fonts will have the greek letters at the same positions, so if you ever wanted to use a different font, you could be in trouble. Or if you ever opened your document on a system that didn't have that font, you won't see the symbols.

The better approach is to use Unicode for the symbols. Unicode is a standard that expands the small set of "normal" characters to a huge set that includes every character ever devised, with room for more. So there is exactly one code for a greek alpha, and every Unicode font that contains an alpha will use that code: U+03b1. In fact, your browser probably supports Unicode already: α No font change is needed; the information in your document is unambiguous and safe.

This issue touches on a number of basic operations in Writer, which are going to be too long to describe here in detail. I suggest you look over the Writer Guide: OOo Guides (PDF), or online.
AOO4/LO5 • Linux • Fedora 23
User avatar
Bhikkhu Pesala
Posts: 1253
Joined: Mon Oct 08, 2007 1:27 am

Re: changing document font without changing symbol font

Post by Bhikkhu Pesala »

If you need to do a lot of search and replace to change font encodings, adapt my search and replace macro by editing the array contents.

Code: Select all

Sub SktToUnicode
oDoc = thisComponent 
aFind = Array("  ", "Æ","æ" ,"Ø", "ø" ,"Þ" ,"þ", "Ð", "ð", "Ḥ", "ḥ", "¡", "¹", "º", "µ", "¤", "¼", "£", "³", "®", "¶", "¾", "½", "±", "ª", "©", "¢", "¿", "¥") 
aReplace = Array(" ", "Ā", "ā", "Ī", "ī", "Ū", "ū", "Ḍ", "ḍ", "²", "¬", "Ḷ", "ḷ", "Ṃ", "ṃ", "Ṇ", "ṇ", "Ṅ", "ṅ", "Ṛ", "ṛ", "Ṝ", "ṝ", "Ṣ", "ṣ", "Ś", "ś", "Ṭ", "ṭ") 
aRayCount = 0 
FandR = oDoc.createReplaceDescriptor 
FandR.SearchCaseSensitive = true
FandR.SearchRegularExpression = true 
While aRayCount <= uBound(aFind) 
 FandR.setSearchString(aFind(aRayCount)) 
 FandR.setReplaceString(aReplace(aRayCount)) 
 aRayCount = aRayCount + 1 
 oDoc.ReplaceAll(FandR) 
Wend 
End Sub
I used it for converting ANSI encoded text to Unicode.
Idiot Compassion
LibreOffice 6.0.4 on Windows 10
huw
Volunteer
Posts: 417
Joined: Wed Nov 21, 2007 1:57 pm

Re: changing document font without changing symbol font

Post by huw »

Bhikkhu Pesala wrote:If you need to do a lot of search and replace to change font encodings, adapt my search and replace macro by editing the array contents.

Code: Select all

Sub SktToUnicode
oDoc = thisComponent 
aFind = Array("  ", "Æ","æ" ,"Ø", "ø" ,"Þ" ,"þ", "Ð", "ð", "Ḥ", "ḥ", "¡", "¹", "º", "µ", "¤", "¼", "£", "³", "®", "¶", "¾", "½", "±", "ª", "©", "¢", "¿", "¥") 
aReplace = Array(" ", "Ā", "ā", "Ī", "ī", "Ū", "ū", "Ḍ", "ḍ", "²", "¬", "Ḷ", "ḷ", "Ṃ", "ṃ", "Ṇ", "ṇ", "Ṅ", "ṅ", "Ṛ", "ṛ", "Ṝ", "ṝ", "Ṣ", "ṣ", "Ś", "ś", "Ṭ", "ṭ") 
aRayCount = 0 
FandR = oDoc.createReplaceDescriptor 
FandR.SearchCaseSensitive = true
FandR.SearchRegularExpression = true 
While aRayCount <= uBound(aFind) 
 FandR.setSearchString(aFind(aRayCount)) 
 FandR.setReplaceString(aReplace(aRayCount)) 
 aRayCount = aRayCount + 1 
 oDoc.ReplaceAll(FandR) 
Wend 
End Sub
I used it for converting ANSI encoded text to Unicode.
You might need to upload that as an attachment for people to be able to use it, or to escape things if that's possible - I'm seeing a lot of square boxes!
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: changing document font without changing symbol font

Post by foxcole »

huw wrote: You might need to upload that as an attachment for people to be able to use it, or to escape things if that's possible - I'm seeing a lot of square boxes!
That doesn't matter. Those are characters your system apparently doesn't support, but if you were using that script, you'd replace those characters in the array with ones you were using.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
huw
Volunteer
Posts: 417
Joined: Wed Nov 21, 2007 1:57 pm

Re: changing document font without changing symbol font

Post by huw »

Okay. I think I see. Thanks
Post Reply