sindresorhus / caprine

Elegant Facebook Messenger desktop app
MIT License
7.05k stars 558 forks source link

Support for the change of custom Font for Khmer Font or Khmer Unicode #429

Open prenfic opened 6 years ago

prenfic commented 6 years ago

My mon is Cambodia-Chinese and usually she will send me some texts in Khmer, (when she dunno how to express herself in Chinese or English), But, here is some example since I installed tons of khmer font for Mac, image and, this is the result I see, image ... quite awful, although I can't read it and literally just copy it and paste to "Google Translate", so,

I would like to ask that,
is there any way,
to change the custom font like, khmer or sth other else.

Postscript, im quite new to the GIthub and "coding" stuff, if yes there it is, please, treat me like a newbie and don't be hesitate to tell me in more and more simplicity please.

dusansimic commented 4 years ago

You could add custom CSS (the thing that specifies how the page is going to look, including fonts) that Caprine will load. To edit custom CSS go to File -> Caprine Settings -> Advanced -> Custom Styles. An editor should open. In that editor, just paste this at the end of the file:

html {
  font-family: "Your Khmer Font", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;
}

Replace Your Khmer Font with the font name you want to use.

I hope this helps.

SZTSIIT commented 2 years ago

You could add custom CSS (the thing that specifies how the page is going to look, including fonts) that Caprine will load. To edit custom CSS go to File -> Caprine Settings -> Advanced -> Custom Styles. An editor should open. In that editor, just paste this at the end of the file:

html {
  font-family: "Your Khmer Font", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;
}

Replace Your Khmer Font with the font name you want to use.

I hope this helps.

It does not work. What you have to do is add this code.

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        'Your Font Name',
        Roboto,
        Oxygen-Sans,
        Ubuntu,
        Cantarell,
        'Helvetica Neue',
        sans-serif,
        'Apple Color Emoji',
        'Segoe UI Emoji',
        'Segoe UI Symbol' !important;
    text-rendering: optimizelegibility !important;
    font-feature-settings: 'liga', 'clig', 'kern';
}

I just got it from here https://github.com/sindresorhus/caprine/blob/main/css/browser.css

Hope it helps.