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

Underscores in Ace Editor are not rendered with Ace default CSS #1279

Closed
davidomarf opened this issue Oct 8, 2019 · 1 comment
Closed

Underscores in Ace Editor are not rendered with Ace default CSS #1279

davidomarf opened this issue Oct 8, 2019 · 1 comment

Comments

@davidomarf
Copy link

I took a look to the Functions page and found this:

image

Being the first time I looked at Rust code, I assumed it was possible to define functions using a whitespace in the name.

When I realized it wasn't true, I tried to open a issue to correct the content of the code and replace the whitespaces in the functions for underscores, however, I noted that they were actually there, but not rendered.


font attribute

This is the default style for Ace blocks:
image

When supressing the font attribute in .ace_editor, the underscore renders properly:
image

WhatFont reports that the font used is monospace:
image

However, when I force monospace to be the chosen font, it works properly:
image

I checked for the installed functions in my OS. This is the result:

$ fc-list | grep -i "Monaco"                                                                                                                               
## nothing

$ fc-list | grep -i "Menlo"          
## nothing

$ fc-list | grep -i "Ubuntu"         
## nothing

$ fc-list | grep -i "Consolas"       
## nothing

$ fc-list | grep -i "source-code-pro"
/usr/share/fonts/adobe-source-code-pro/SourceCodeVariable-Roman.otf: Source Code Variable:style=Light
## ... several more lines

'source-code-pro', monospace

Apparently, that's the problematic combination. If I only leave source-code-pro in the list of fonts to use, it defaults to serif:
image

'Source Code Pro'

If I replace 'source-code-pro' with 'Source Code Pro', it renders properly:

image

Proposed solutions

a. Replace 'source-code-pro' with 'Source Code Pro' with a script (since it's not provided and generated from ace.js script).
b. Add !important to code { font-family } in general.css


If needed or relevant, this is my environment:
OS: Manjaro 18.1.0
Chrome: 77.0.3865.90

@davidomarf davidomarf changed the title Underscore in Ace Editor are not rendered with Ace default CSS Underscores in Ace Editor are not rendered with Ace default CSS Oct 8, 2019
@davidomarf
Copy link
Author

After checking some of the files in this repository, I realised that the appropiate repository should be rust-lang-nursery/mdBook.

I'm moving this there, and closing as it feels appropiate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant