Ask Your Question
0

(LibreCalc) How to Change the Font of all Text in a Certain Language

asked 2018-09-27 23:35:40 +0200

Eriias gravatar image

Hello!

I am working on a Calc document that contains text in Japanese and English. I want all of the Japanese characters to use the MS Gothic font, and all of the English and numbers to use the Calibri font.

Is there any way to effect this change across the whole document? Selecting each English word/group of numbers and changing them one by one is VERY time consuming and tedious.

In this case I am not married to using Calibri, I just want something that is neater and bolder than what is used in MS Gothic, whereas I very much like how the Japanese text looks in that font.

Any and all recommendations/suggestions would be welcome. Thank you for your time. -Eriias

edit retag flag offensive close merge delete

Comments

Need info!
I may not be the one who can help you. But anybody trying to help you will need sufficient information.
In what way is "English text" reliably distinguishable from "Japanese text" in technical terms?
Are there used disjunct (or next to disjunct) character sets?
Can both languages occur in the same cell?
Did you use the 'Language' property under Format Cells... > Numbers ?
What else can you offer?
Specific font names are irrelevant.

Lupp gravatar imageLupp ( 2018-09-28 14:43:03 +0200 )edit

I didn't realize I needed to know the coding terms for languages to ask a question. I do not know how to distinguishes roman letters from 漢字・カタカナ・ひらがな in "technical terms." In this case I mean letters, numbers, and punctuation utilized in English in one category, and everything else in another. I don't know what you mean by disjunct in this context. They can appear in the same cell. I don't know what property you're referring to. I tried Format Cells>Number Format>Numbers but nothing happened.

Eriias gravatar imageEriias ( 2018-09-28 22:09:44 +0200 )edit

Be sure I don't ask just for fun. I am trying to help you, and have to expend time. To provide the needed information may also require time.

Lupp gravatar imageLupp ( 2018-09-28 22:52:15 +0200 )edit

Sorry, I get easily frustrated with this kind of thing and I read your comment as coming off somewhat rudely. I appreciate you trying to help.

I still don't know what you mean by disjunct though, nor what the Number property is.

Eriias gravatar imageEriias ( 2018-09-28 23:17:40 +0200 )edit

The simplest case of 'number' as a part of a text is the unsigned integer decimal number described by [1-9][0-9]* as a regular expression. English words are not distinguishable from words in other languages which are also written with Latin letters by syntactical means only. You need a huge dictionary. But dictionaries may intersect (that's not being disjunct). A word written in Japanese characters is likely to be a Japanese word. However, it's not really simple by that.

Lupp gravatar imageLupp ( 2018-09-29 00:16:01 +0200 )edit

5 Answers

Sort by » oldest newest most voted
1

answered 2018-10-01 00:22:30 +0200

Eriias gravatar image

Styles was definitely the answer. I experienced very odd inconsistencies in trying to modify the default style, but just creating new ones got them to work almost perfectly. There were a few times where it would only modify part of the Japanese text in a line, but that was easy enough to fix "by hand" the one time.

Thank you all for the suggestions and the information. I really appreciate all of your efforts to get me through this. :)

edit flag offensive delete link more

Comments

Setting a style does not always work, at least in Writer. I apparently cannot include a screenshot here, but selecting a block of text in SimSun into which I have typed latin alphanumerics (I am translating the document) leaves them in SimSun. I would like all western text in this paragraph to use e.g. Book Antiqua, so following the advice of this post I defined a style in which western text should use Book Antiqua while Asian text should use SimSun. Selecting a block of text and applying the style sometimes produces the desired result and other times does not; the western text remains in SimSun. I just did this in a Writer document table in which each cell contained Chinese characters and western letters, and the western text changed to Book Antiqua in only some of the cells (table is 4x3 plus top title box: the title box ...(more)

satkomuni gravatar imagesatkomuni ( 2018-12-24 01:40:36 +0200 )edit
0

answered 2018-09-29 00:05:31 +0200

Lupp gravatar image

(There are Japanese characters assigned to unicode code points. But also there can be fonts assigning Japanese glyphs to code points officially used for other purposes. That's technical e.g. Software is a technical thing.)
I don't know anything about Japanese. Just looked around a bit.

Japanese is written in Hiragana and/or Katakana chartacters. Unicode has assigned code points in the range o U+3000 to U+31FF to these characters. If "Japanese text" is exclusively written with these characters, you can find it in principle with the help of a regular expression (RegEx). To construct an actually working search expression accepting exactly non-empty sequences of the mentioned characters, shaped as usable in LibO will again require as well some knowledge about writing in Japanese as about technical aspects of the unicode system. The "first idea" [\u3000-\u31FF]+ doesn't work as expected. In Calc anyhow such an expression will find the cells containing a match. You can(?) use

[ 、。〃〄々〆〇〈〉《》「」『』【】〒〓〔〕〖〗〘〙〚〛〜〝〞〟〠〡〢〣〤〥〦〧〨〩〪〭〮〯〫〬〰〱〲〳〴〵〶〷〸〹〺〻〼〽〾〿぀ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんゔゕゖ゗゘゙゚゛゜ゝゞゟ゠ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶヷヸヹヺ・ーヽヾヿ㄀㄁㄂㄃㄄ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦㄧㄨㄩㄪㄫㄬㄭㄮㄯ㄰ㄱㄲㄳㄴㄵㄶㄷㄸㄹㄺㄻㄼㄽㄾㄿㅀㅁㅂㅃㅄㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎㅏㅐㅑㅒㅓㅔㅕㅖㅗㅘㅙㅚㅛㅜㅝㅞㅟㅠㅡㅢㅣㅤㅥㅦㅧㅨㅩㅪㅫㅬㅭㅮㅯㅰㅱㅲㅳㅴㅵㅶㅷㅸㅹㅺㅻㅼㅽㅾㅿㆀㆁㆂㆃㆄㆅㆆㆇㆈㆉㆊㆋㆌㆍㆎ㆏㆐㆑㆒㆓㆔㆕㆖㆗㆘㆙㆚㆛㆜㆝㆞㆟ㆠㆡㆢㆣㆤㆥㆦㆧㆨㆩㆪㆫㆬㆭㆮㆯㆰㆱㆲㆳㆴㆵㆶㆷㆸㆹㆺㆻㆼㆽㆾㆿ㇀㇁㇂㇃㇄㇅㇆㇇㇈㇉㇊㇋㇌㇍㇎㇏㇐㇑㇒㇓㇔㇕㇖㇗㇘㇙㇚㇛㇜㇝㇞㇟㇠㇡㇢㇣㇤㇥㇦㇧㇨㇩㇪㇫㇬㇭㇮㇯ㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ
]

as a Regex, but it doesn't look like a final solution. Try a web-search for "regular expression for japanese characters".

To first mix up text pieces in two languages inside single cells and then to expect them to be separately treatable by the software is somehow bold. You may find a solution to separate English from Japanese thinking the technical way, and I may try to help you again with it when I find time. Alas! It's completely useless if you just want to base an even worse mistake on it: Using different fonts inside of single cells as a rule instead of as a rare exception.

edit flag offensive delete link more

Comments

I see. Thank you for the explanation, that helps clear some things up. I'm wondering if somehow the text in this document got assigned the wrong language code to begin with? When I first sent it to a friend for proofreading, she said the font was in Chinese which made no sense to me. That's why I'm messing with fonts at all, I changed it from the default to MS Gothic because i knew that was a Japanese font I'd used....

Eriias gravatar imageEriias ( 2018-09-29 00:25:25 +0200 )edit

Is it possible that this file just got so garbled that the displayed language is not the same as the coded one? I say this because in trying to use cell styles to fix this, I'm noticing that "western" fonts defined in the style apply fine (as do other parameters) but the Japanese font I have defined under "Asian" fonts does not.

Eriias gravatar imageEriias ( 2018-09-29 00:27:15 +0200 )edit

-1- Japanese characters go back to Chinese logographic glyphs. In a sense they are the same, and are also used in that way in specific cases (I was told once). "Katakana looks Chinese."
-2- You cannot assign languages to text pieces ('Selection') in Calc. Cells have a language property which only should influence numeric default formats and input.
-3- Where did you define a "Japanese font"?

Lupp gravatar imageLupp ( 2018-09-29 00:56:22 +0200 )edit

To find text portions - not just cells - with F&R you need to transfer the contents to a text-table in Writer. Use RichTextFormat for the move in both directiopns..

Lupp gravatar imageLupp ( 2018-09-29 01:01:14 +0200 )edit
  1. Yeah, kanji are (basically) chinese characters, though I was warned by the friend doing the proofreading that they are "somewhat different" and that I should change the font because it "looks weird".
  2. I went Styles (F11) > default > modify > Font, and the bottom portion of that is "Asian Text Font" and it has a box to define which language is being used. It had been set to Chinese, I changed that to Japanese while also changing the font itself.
Eriias gravatar imageEriias ( 2018-09-29 03:15:36 +0200 )edit

Throwing it into Writer as a table might be a good idea. I had tried just saving as xlsx and opening it in Excel again but that messed up a good chunk of formatting so I thought it wasn't worth the hassle there to solve this hassle. But if I can pass it back and forth from Writer without things getting mangled, that could work....

Eriias gravatar imageEriias ( 2018-09-29 03:16:58 +0200 )edit
0

answered 2018-09-29 08:40:11 +0200

As explained in the ICU User Guide's Regular Expressions page, you can use \p{script=foo} or [:script=foo:] syntax to filter by "script" Unicode property. Combining this with information from Wikipedia, you can use regular expressions like [[:script=Han:][:script=Hiragana:][:script=Katakana:]]+ to search for these characters.

However, this won't include the spaces and other non-specific characters into the result, which might give you less-than-ideal results.

edit flag offensive delete link more

Comments

Thnks. Another thing I should have known.

Lupp gravatar imageLupp ( 2018-09-29 15:13:11 +0200 )edit
1

That seems like it would be a better solution if I knew how to use it, but with more experimenting, I found that just creating a new style seemed to get rid of the odd inconsistencies I was experiencing. The styles option worked wonders after that.

Eriias gravatar imageEriias ( 2018-09-30 23:27:08 +0200 )edit

The styles option worked wonders after that.

Congratulations! That really is the better and correct way.

Mike Kaganski gravatar imageMike Kaganski ( 2018-10-01 08:23:55 +0200 )edit
0

answered 2018-09-28 09:30:19 +0200

gabix gravatar image

Modify the Default style and/or other styles accordingly.

edit flag offensive delete link more
0

answered 2018-09-28 13:52:18 +0200

Sarum4n gravatar image

I agree with gabix that this problem calls for Styles to be applied. Except that the use of two languages may require that new styles are to be created besides the existing ones. So if English is the prevalent language, I'd modify Default style to use that language & the accompanying font (Calibri or something), so that all text (and thus all English texts) have the desired looks. Then for each type of Japanese text create a copy of the applied style that has the font and language settings changed. If it's only one or two types of styles, then creating new styles is easy. If it's more, then you might want to recreate a part of the styles tree, so that future maintenance of the styles gets easier.

edit flag offensive delete link more

Comments

Good point, but for a case when two languages use different scripts creating different styles is superfluous. Just set different fontfaces in the font properties tab.

gabix gravatar imagegabix ( 2018-09-28 16:12:08 +0200 )edit

Ok so I found how to modify styles, and that seems like it should work. The odd thing is, it doesn't. The English letters etc. change, but the Japanese characters do not. I believe this might be an error that came with the file, namely that the Japanese characters were somehow coming out as Chinese. So perhaps changing the Asian font to Japanese isn't affecting a change because the program thinks I've been typing in Chinese?

Eriias gravatar imageEriias ( 2018-09-28 23:18:47 +0200 )edit

It in fact seems to act VERY inconsistently. It'll apply the font size and alignment without fail but will sometimes not even change roman letters, and seems to have no effect at all on Japanese text, despite selecting a Japanese font under Asian fonts for the style...I'm very confused...

Eriias gravatar imageEriias ( 2018-09-28 23:52:42 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-09-27 23:35:40 +0200

Seen: 180 times

Last updated: Oct 01 '18