ModelicaBook icon indicating copy to clipboard operation
ModelicaBook copied to clipboard

font for keywords is not distinctive enough to differentiate it from normal text

Open mrtiller opened this issue 10 years ago • 17 comments

bolding or underlining keywords might be one solution

mrtiller avatar Dec 18 '13 00:12 mrtiller

What about using italics in combination with colour?

dietmarw avatar Dec 18 '13 11:12 dietmarw

Note that this is only a CSS issue, and need not affect the text of the book.

xogeny avatar Dec 18 '13 13:12 xogeny

Are we talking about code snippets here?

dietmarw avatar Dec 18 '13 23:12 dietmarw

I was referring to the text that is not part of the code snippets.

On Wed, Dec 18, 2013 at 5:10 PM, dietmarw [email protected] wrote:

Are we talking about code snippets here?

— Reply to this email directly or view it on GitHubhttps://github.com/xogeny/ModelicaBook/issues/15#issuecomment-30890693 .

mrtiller avatar Dec 18 '13 23:12 mrtiller

Does anybody see this as in issue? Is it an issue in the current beta at http://beta.book.xogeny.com/ or in any of the electronic formats (PDF, ePub). If so, please specify exactly what the issue is and in what media it appears.

xogeny avatar Apr 11 '14 20:04 xogeny

The most conventional choice for fonts would be to use

  • a serif font for the running text (with the idea of the serifs guiding the eye while reading),
  • a sans-serif font for headlines and
  • a monospace, serif font (typewriter style) for code.

This is what you will also find in many books and papers. Currently, you are using the exact opposite . Nobody will mistake running text for code, I guess, but the idea is to make reading long texts less tiring. If changing the font is not too hard, you might just experiment what gives the most pleasant look.

If you want to make the difference even stronger, then one way could be to use a light-gray background color, as they do it on stackoverflow or github. This works nicely for both inline code snippets as well as code blocks.

Another basic typographic rule would be to not use more than 60-70 characters per line, maximum 80. Shorter lines are easier to read (that's the reason for multiple columns in newspapers or articles). This might be easier to implement in pdf than in HTML/Epub (I have only seen the HTML version so far).

If you were aware of all this, then sorry for hijacking the thread.

thorade avatar Apr 11 '14 21:04 thorade

No, this is good. I'm looking for specifics here. Thanks.

xogeny avatar Apr 11 '14 21:04 xogeny

Here is a nice potential font for headlines (the one used in the headline on the page):

http://tylermcginnis.com/angularjs-factory-vs-service-vs-provider/

xogeny avatar May 07 '14 15:05 xogeny

There are some nice free fonts available under the SIL Open Font License: http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_fonts The license is explained here: http://en.wikipedia.org/wiki/SIL_Open_Font_License

Especially interesting are Linux Libertine (serif) + Linux Biolinum (sans-serif) http://en.wikipedia.org/wiki/Linux_Libertine http://www.linuxlibertine.org/ These two go well together and are used widely. These also have a monospace version, but I guess it would be good to use a more distinctive font. Maybe Inconsolata?

Another intersting serif font is Stix (or XITS in LaTeX): http://www.stixfonts.org/ http://en.wikipedia.org/wiki/STIX_Fonts_project I believe it has a serif, sans-serif and monospace version.

The Adobe Source Sans Pro and Adobe Source Code Pro are also worth looking at http://en.wikipedia.org/wiki/Source_Sans_Pro http://en.wikipedia.org/wiki/Source_Code_Pro Both are proportional, not monospace.

Even more free fonts are listed here: http://en.wikipedia.org/wiki/Free_software_Unicode_typefaces or here: http://openfontlibrary.org/ unfortunately, the second list cannot be sorted or filtered.

thorade avatar May 07 '14 16:05 thorade

I still haven't decided what to do about this, but I was reading this book on my iPad and though the fonts they chose were quite nice:

http://viget.com/extend/diving-into-go-a-five-week-intro

xogeny avatar Jun 09 '14 18:06 xogeny

Yes, looks nice. Firefox says they used Calluna (Sans). It was published by exljbris as serif and sans-serif font: http://www.exljbris.com/calluna.html http://www.exljbris.com/callunasans.html Don't know about fixed-width/monospace or math support. It seems to be not (completely) free, but paying once for a good font seems to be just fair.

thorade avatar Jun 10 '14 10:06 thorade

Another font I liked is the one used here:

http://technosophos.com/2014/07/24/9-things-i-like-about-go.html

xogeny avatar Aug 01 '14 20:08 xogeny

I just pushed out a new version (v0.3.3) to http://book.xogeny.com

The main change (with respect to this issue) is the use of sans-serif fonts for the headings. I think this looks much better. I looked at a couple of fonts for the running text but I still like this one. I guess I'm violating @thorade's principle of serifed fonts for running text. But at least the headings look better.

Any comments?

(Note, I'm not closing this issue yet, because I'm open to other improvements)

xogeny avatar Aug 10 '14 12:08 xogeny

The issue I have with sans-serif fonts for the running text is that the distinction between normal text and fixed font code examples is almost not visible. Here an example taken from the HTML version: events 2014-08-10 18-01-00 and as seen in the PDF version which uses serif font for running text. screenshot from 2014-08-10 18 03 00

I find it much easier to recognise code in the latter example.

dietmarw avatar Aug 10 '14 16:08 dietmarw

There is something odd going on here. The sample of text from the HTML version that you have shown does not look like what I see when I look at the book. The reason is that for me it is choosing Optima which is available (apparently?) as a system font on my OSX machine.

I like the look of Optima. So I'd like to keep it "first" in the list of fonts. But if you have suggestions for something that works better on Linux and/or Windows. I'm open to suggestions. I just changed the CSS to use "Domine" as the next choice. This is available via Google's web fonts (i.e. anybody can use it). So try doing a "Shift-Reload" on the page and look at the fonts to see if it is any better.

xogeny avatar Aug 10 '14 16:08 xogeny

You are right I did have the cached version. Still the newer version doesn't look much of an improvment wrt. distintiction of fixed width code snippets: events 2014-08-10 21-29-25 What about doing it the way GitHub does it?

dietmarw avatar Aug 10 '14 19:08 dietmarw

Some more problems with the font: modelica by example

The spacing for line-break needs to be patched a bit.

dietmarw avatar Aug 11 '14 06:08 dietmarw