Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propose to change Chinese layer default font #3120

Closed
louy2 opened this issue Sep 24, 2015 · 17 comments
Closed

Propose to change Chinese layer default font #3120

louy2 opened this issue Sep 24, 2015 · 17 comments
Labels
Chinese Discussion Fonts stale marked as a stale issue/pr (usually by a bot)

Comments

@louy2
Copy link
Contributor

louy2 commented Sep 24, 2015

@zilongshanren
Since Spacemacs is promoting Source Code Pro as its default font, I propose Source Han Sans or Noto Han Sans as Chinese layer default to keep things aligned.

@zilongshanren
Copy link
Contributor

@louy2
Source Han Sans and Noto Han Sans is for Chinese only or both ?

@louy2
Copy link
Contributor Author

louy2 commented Sep 24, 2015

Those are actually the same font, Source published by Adobe while Noto published by Google. Chinese only, they contain normal Source Sans glyphs for other things.

@zilongshanren
Copy link
Contributor

@louy2
The default chinese font doesn't enable by default.

;; If the Hiragino Sans GB font is not found in your system, you could call this
;; method in dotspacemacs/config function with a different Chinese font name.
;; If you are using mac, you could put the following code in your dotspacemacs/config function.
;; (when (spacemacs/system-is-mac)
;;   (spacemacs//set-monospaced-font "Source Code Pro" "Hiragino Sans GB" 14 16))

I think you could change it to whatever you want.

@louy2
Copy link
Contributor Author

louy2 commented Sep 25, 2015

I know and I've done exactly that. But what you do you think if we actually enable Source Han Sans by default? I was a bit confused when I installed Chinese layer and still had codepoint glyphs displayed, and had to dig to the document. Source Han Sans is already recommended among font enthusiasts, so I think it is good enough to be made default.

@StreakyCobra
Copy link
Contributor

Any news on this discussion? Are you planing to PR it, or it is an abandoned idea?

@louy2
Copy link
Contributor Author

louy2 commented Nov 16, 2015

If changing the font in Chinese layer still ensures a safe fallback when Source Han Sans is not installed, then I'd like to PR. So question: how does Emacs resolve its fonts?

@StreakyCobra
Copy link
Contributor

I'm not sure to understand your question?

@louy2
Copy link
Contributor Author

louy2 commented Nov 16, 2015

For example in CSS I can specify a number of fonts and have the browser fallback in order. Do I need to write some logic to achieve that in Emacs?

@eitazhou
Copy link

Use Source Code Pro only , and I can't align Chinese character and English character in a table when I edit under Org mode.

@louy2
Copy link
Contributor Author

louy2 commented Dec 25, 2015

@eitazhou It is possible to set different font sizes for Chinese and English with (spacemacs//set-monospaced-font "Source Code Pro" "Hiragino Sans GB" 14 16). You'd need to find a proper combo to make them align.

@kingFighter
Copy link

@louy2 Do you find how to set font fallback in spacemacs just like css?
I tried

  (set-fontset-font t 'unicode "Symbola")
  (set-fontset-font t 'unicode "Symbola" nil)
  (set-fontset-font t 'unicode "Symbola" nil 'append)
  (set-fontset-font t 'unicode "Symbola" nil 'prepend)
 (set-fontset-font "fontset-default" nil 
                  (font-spec :size 20 :name "Symbola"))

with dotspacemacs/user-config.
Not work for me.

@louy2
Copy link
Contributor Author

louy2 commented Dec 25, 2015

@kingFighter
I have not been actively on it. For now you can try (set-fontset-font "fontset-startup" nil "Symbola" nil 'append).

Ref: https://www.gnu.org/software/emacs/manual/html_node/emacs/Modifying-Fontsets.html#Modifying-Fontsets

@kingFighter
Copy link

@louy2 Thanks. I tried

(set-fontset-font "fontset-startup" 'unicode (font-spec :name "Consolas"
                                                          :size 20
                                                          :width `normal'
                                                          :weight `normal'
                                                          :powerline-scale 1.1) nil 'prepend)
(set-fontset-font "fontset-startup" 'unicode (font-spec :name "Source Code Pro"
                                                          :size 20
                                                          :width `normal'
                                                          :weight `normal'
                                                          :powerline-scale 1.1) nil 'prepend)

with dotspacemacs/user-config. It seems work.But properities like width and weight( normal or 'normal' or ``normal'` not working.

@louy2
Copy link
Contributor Author

louy2 commented Dec 27, 2015

@kingFighter
For :width and :weight properties you need to choose from a list of symbols, which means you need to specify them as :width 'normal and :weight 'normal. Symbol is a special type, not string.

Ref:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html#Face-Attributes
https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Symbols.html#Creating-Symbols
https://www.gnu.org/software/emacs/manual/html_node/elisp/Quoting.html#Quoting

@kingFighter
Copy link

@louy2
Really thanks for your suggestion and refs. It worked now.
Thanks again.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
@louy2 louy2 closed this as completed Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chinese Discussion Fonts stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

6 participants