hundredrabbits / Left

Distractionless Writing Tool
http://hundredrabbits.itch.io/left
Other
1.78k stars 144 forks source link

Change font & font size #95

Closed jrc03c closed 5 years ago

jrc03c commented 5 years ago

I added the ability to toggle through fonts using ctrl+< and ctrl+>. As per issue #49, there are three fonts: Input Mono Regular, a serif, and a sans-serif. The serif and sans-serif fonts can be customized by replacing the serif.ttf and sans_serif.ttf files in the media/fonts folder. (Currently, they're Zilla Slab and Roboto Condensed.) The font size can also be increased with ctrl++, decreased with ctrl+-, and reset with ctrl+).

pacocoursey commented 5 years ago

Remember that Left is now using the Standard style guide. Run npm run lint to view any errors.

I played with this idea a while back and found bugs with the reader mode. Because the reader mode basically inserts and quickly removes a div element so it knows when to scroll to, ensure that the CSS rule for body div reflects any changes in font-size and line-height (otherwise the inserted div will be the wrong height, and the reader mode will eventually become misaligned with the text).

I'd also change the keybind to show Cmd+Shift+. rather than Cmd+>, as the latter makes me want to press Cmd+.. Just my opinion though. Also, I think the decrease font size shortcut is Cmd+Shift+- right now, instead of the desired Cmd+-. And it's more common to use Cmd+0 to reset the size, without the shift modifier.

The menu ordering also feels a bit off, maybe a new section for "Font" works better than splitting the options between "View" and "Theme".

Nice work!

jrc03c commented 5 years ago

@pacocoursey Thanks for the notes. I hadn't known about the style guide, and I didn't even think to check the line-height problem. I've sorted out the other things, I think, but the line-height is still being a pain. :(

jrc03c commented 5 years ago

@pacocoursey Thanks for the PR!

neauoire commented 5 years ago

I'm currently away from the computer while we re-stock. I'll check the PR when I get back :) Sorry

(it looks awesome, and I'm excited to give this a try!)

neauoire commented 5 years ago

This is incredible.