ruddfawcett / Notepad

[iOS] A fully themeable markdown editor with live syntax highlighting.
http://rudd.fyi/notepad
MIT License
876 stars 105 forks source link

Use System Font #61

Open ivancantarino opened 4 years ago

ivancantarino commented 4 years ago

Hi there,

Before it all, thanks for sharing this project. It's pretty cool. I was digging around the themes, and will probably create a custom one myself, though I noticed the fonts used are the ones that are listem in the system.

Is there a way to use the system font, such as UIFont.systemFont(ofSize: CGFloat, weight: UIFont.Weight) ?

ivancantarino commented 4 years ago

I have managed to do it within the Theme.swift file inside the parse function, where I just overwrite the font property, before the return to whatever font I desire.

Is there a better way?

ruddfawcett commented 4 years ago

Hey, @Ivan-Cantarino, thanks for the note — appreciate it! So yes — there should be a way to use UIFont.systemFont(...), and I was going to suggest the solution you came up with for now. I think, eventually (and I'll have to dig back into the project at some point), there should be more defined defaults/a base Theme that others inherit from; hopefully, this will remove the need to explicitly overwrite options such as system default typefaces in the future.