Pixel, Point, or, EM as base font for online and print

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Limits Tester
Jr. Propeller Head
Posts: 9
Joined: Mon Aug 21, 2017 8:48 am

Pixel, Point, or, EM as base font for online and print

Post by Limits Tester »

Hi All!

I'm going nuts here. There is so much information out there on how to establish a base font size when you are going to generate both PDF and online help output. And, to make it more confusing, I cannot tell which "rules" are still applicable. I have a Flare project that produces two targets -- one for PDF and one for Online Help. Both targets use the same style sheet which has a print media and a non-print media section. Many of the styles in the style sheet use .em to specify font-size. Because the base font size is the standard 16px (12pt), and a decision was made to make the font smaller, all the paragraph styles specify 0.8 em. All of the heading styles specify 1.+ em.

My thought is to specify the smaller font size 13px (which equates to 10pt) in the body tag of the css file. Is this an advisable approach? Is it preferable to specify the actual point size? If I do, will that work for both PDF and online help?

Thank you for any assistance.

Linda
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Pixel, Point, or, EM as base font for online and print

Post by NorthEast »

Limits Tester wrote:My thought is to specify the smaller font size 13px (which equates to 10pt) in the body tag of the css file. Is this an advisable approach? Is it preferable to specify the actual point size? If I do, will that work for both PDF and online help?
Yes. Yes. Yes.

I'd suggest that you set the body font-size to the size you want to use for your normal paragraph text; e.g. default medium 13px, print medium 10pt. That will mean 1em = 13px/10pt.

The font-size of your headings is set in ems, relative to this '1em' body size.

Code: Select all

body 
{
	font-size: 13px;
}

@media print
{
	body
	{
		font-size: 10pt;
	}
}
Limits Tester wrote:all the paragraph styles specify 0.8 em.
You can get rid of all the font-sizes in your paragraphs, as they'll be set by the body.

In fact, look for anywhere that you set a font-size in your stylesheet, and remove it if you don't need it. You only need to set a font size if it's not 1em.

Then if you later change the standard size again - you just change it in the body and nowhere else.
Limits Tester
Jr. Propeller Head
Posts: 9
Joined: Mon Aug 21, 2017 8:48 am

Re: Pixel, Point, or, EM as base font for online and print

Post by Limits Tester »

I appreciate the reply. So, I should use pt for print and px for default? Thank you.

Linda
Post Reply