3

I’ve created a custom dictionary with the Dictionary Development Kit and added it to Dictionary.app on my Mac. It’s working fine but there is one stylistic issue I would like to fix.

The dictionary is for looking up pronunciations of individual Chinese characters and I want the entries to be displayed in a Chinese font. That was not a problem in the body of the dictionary. I just needed to define styles in the CSS file for the tags that use in my XML file. However, the left search list (where you choose from multiple entries that match your search keyword) is still showing the characters in a Japanese font. As an example, the vertical bar of 直 shows up (if you know Japanese or Chinese). The standard Chinese dictionaries I have added to Dictionary.app all show it without the vertical bar, which suggests they are using Chinese fonts. So there must be a way to customize the font in the search list for each dictionary. I just can’t figure out how.

On macOS 13.2.1 (22D68) Ventura, is this font customization possible in Dictionary app?

4
  • Super question - I'll edit this to assume you are on the latest macOS. Please edit again if you require an answer on a different macOS version.
    – bmike
    Commented Mar 16, 2023 at 17:48
  • 1
    Do you already have Chinese higher on the system preferred language list than Japanese? That should normally ensure Chinese versions are always used. Commented Mar 16, 2023 at 18:58
  • @TomGewecke - Thanks for your suggestion. I moved up Chinese above Japanese and it indeed changed the font there. However, I don’t think this is what I want because being a system-level setting it affects all applications. I primarily use Japanese on TextEdit, Notes, etc. Built-in Chinese dictionaries display search results in Chinese fonts despite the preferred languages and I would like to imitate that.
    – user491078
    Commented Mar 16, 2023 at 23:18
  • You are right, it is strange that the Dictionary Development Kit would not give you the same results in this regard as the ones that are installed by Apple (but instead let it be determined by the OS setting). Commented Mar 17, 2023 at 4:40

1 Answer 1

1

I figured this out myself.

I only needed to add the following key-value pair in MyInfo.plist.

<key>DCSDictionaryPrimaryLanguage</key>
<string>zh_TW</string>

Curiously, this seems to have the desired effect in the search list only if the <d:index> tags in the XML file contain the "d:yomi" attribute.

0

You must log in to answer this question.