Hanging Paragraph output issue

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Hanging Paragraph output issue

Post by QuadraQ »

Hi all,

With the help of some of the fine folks here on the forums I was able to create a hanging paragraph style that is heavily used in our documentation. For more details see this thread: http://forums.madcapsoftware.com/viewto ... f=6&t=8685

The resulting class looks like this:

Code: Select all

span.CPPurpose
{
	font-family: Impact;
	font-size: 14pt;
	margin-left: -1.00in;
	float: left;
	padding-top: -0.0625in;
}

p.CPPurposePar
{
	font-size: 11pt;
	font-family: 'Times New Roman';
	margin-bottom: 0.75em;
	mc-auto-number-class: CPPurpose;
	mc-auto-number-format: 'Purpose:';
	margin-left: 1in;
	mc-hyphenate-shortest-word: 6;
	mc-hyphenate-shortest-prefix: 3;
	mc-hyphenate-shortest-suffix: 3;
	mc-hyphenate-maximum-adjacent-line-count: 0;
}
Anyway this works nicely in the editor, and when outputting to PDF. Here's how it's supposed to look, using a screenshot from the editor:
Hanging Paragraph Flare.png
The trouble starts when I output to HTML help or Web help. Then I get this:
Hanging Paragraph HTML.png
For some reason the "Purpose:" no longer lines up with the baseline of the text to the right. Is this a bug?
You do not have the required permissions to view the files attached to this post.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Hanging Paragraph output issue

Post by LTinker68 »

It could be an optical illusion, but it looks like the font settings for the style are different in the online (default) medium than they are in the print medium. Or the parent tag (e.g., the body tag or the base <p> tag) has some font settings that are declared in the default medium that are being override in the print medium. In particular, the online version the text looks like the spacing has been adjust because the characters look closer together. So check the styles as they're set in the default medium and the print medium, and if they look the same then go up a tag level (e.g., compare the <p> tags then compare the body tags).

Also, as an aside and this might have been mentioned in the other thread, but I wouldn't use Impact for the online version -- I'm not sure that's a font installed by default on PCs and Macs and such.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Re: Hanging Paragraph output issue

Post by QuadraQ »

LTinker68 wrote:Also, as an aside and this might have been mentioned in the other thread, but I wouldn't use Impact for the online version -- I'm not sure that's a font installed by default on PCs and Macs and such.
I've been using this website as my guide for selecting fonts: http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html

According to it Impact is one of the "safe" fonts as long as I don't use bold or italic, which I'm not.
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Re: Hanging Paragraph output issue

Post by QuadraQ »

I don't think the problem has to do with differences between the print medium and the non-print medium. The only print medium specific settings are:

Code: Select all

@media print
{
	body
	{
		background-color: #ffffff;
		padding-right: 0em;
		padding-left: 0em;
		border-bottom-width: 0em;
		border-left-width: 0em;
		border-right-width: 0em;
		border-top-width: 0em;
	}
}
As for the parent tags I'm not sure what I'm looking for. Here's what I have:

Code: Select all

body
{
	color: #000000;
	background: #F1F2EC;
	font-size: 70%;
	font-family: Verdana, Arial, Helvetica, Sans Serif;
	margin-left: 0em;
	padding-left: 1.5em;
	padding-right: 1em;
	border-bottom-width: .5em;
	border-left-width: .5em;
	border-right-width: .5em;
	border-top-width: .5em;
	background-color: #F1F2EC;
}

p
{
	margin-bottom: .5em;
	margin-top: .5em;
}

span.CPPurpose
{
	font-family: Impact;
	font-size: 14pt;
	margin-left: -1.00in;
	float: left;
	padding-top: -0.0625in;
}

p.CPPurposePar
{
	font-size: 11pt;
	font-family: 'Times New Roman';
	margin-bottom: 0.75em;
	mc-auto-number-class: CPPurpose;
	mc-auto-number-format: 'Purpose:';
	margin-left: 1in;
	mc-hyphenate-shortest-word: 6;
	mc-hyphenate-shortest-prefix: 3;
	mc-hyphenate-shortest-suffix: 3;
	mc-hyphenate-maximum-adjacent-line-count: 0;
}
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Hanging Paragraph output issue

Post by LTinker68 »

The body tag under the default medium has a font size of 70% but the body tag under the print medium doesn't have a font size set, so it's using the same 70% value. The span and p class tags you defined in the earlier post are using point values for the font size. I can't tell from that post if those styles were set in the default medium or the print medium. If they were set in the print medium, then see what they're set to in the default medium (the values could be different, resulting in what you see). If they were set in the default medium, then you might want to try removing the font sizes in the default medium (or set them in relation to the body font size of 70%) and specify those point sizes for those styles under the print medium.

Use ems, %, or pixels for font sizes in the default (online) medium and use points for font sizes in the print medium.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Re: Hanging Paragraph output issue

Post by QuadraQ »

LTinker68 wrote:Use ems, %, or pixels for font sizes in the default (online) medium and use points for font sizes in the print medium.
Forgive me, I'm trying to understand your post. You seem to be saying that font sizes work differently in print than they do in default (web) medium. That's a new concept to me, so I'm wondering if someone could expand on how that works.

I'm also wondering based on your comments about the negative offset that I defined for the span class that's used for the "Purpose" text. I have it defined as: padding-top: -0.0625in;

Is it possible that measurement defined in inches doesn't translate properly to the non-print mediums?
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Hanging Paragraph output issue

Post by KevinDAmery »

QuadraQ wrote:Forgive me, I'm trying to understand your post. You seem to be saying that font sizes work differently in print than they do in default (web) medium. That's a new concept to me, so I'm wondering if someone could expand on how that works.
Yes they do, because in online formats you want your users to be able to resize the text to suit their own needs using the browser text size controls: in print, of course, this isn't possible.

- For online formats, it's best to use a proportional size like em or percentage so that the browser size controls work. What you are doing is telling the browser the font size for each style in relation to the other styles as a percentage of a defined base. When the user scales up the browser setting, it replaces that defined base with a larger value: everything in the help system then resizes relative to the revised base.

- For print formats, this type of thing isn't possible (paper is lousy at resizing itself....) Additionally, the print output formats (Word, FrameMaker, and PDF) don't have any support for resizable text. So for print, you need to use a hard font size measurement like points, inches, centimeters, etc.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Re: Hanging Paragraph output issue

Post by QuadraQ »

KevinDAmery wrote: - For online formats, it's best to use a proportional size like em or percentage so that the browser size controls work. What you are doing is telling the browser the font size for each style in relation to the other styles as a percentage of a defined base. When the user scales up the browser setting, it replaces that defined base with a larger value: everything in the help system then resizes relative to the revised base.

- For print formats, this type of thing isn't possible (paper is lousy at resizing itself....) Additionally, the print output formats (Word, FrameMaker, and PDF) don't have any support for resizable text. So for print, you need to use a hard font size measurement like points, inches, centimeters, etc.
OK great, I think I have the idea. I still need a little more clarification about a couple of other things though:

1) How would I properly translate the text sizes I have currently into percentages for non-print output? (I'm assuming the font sizes should be moved into the print medium section of the css - correct me if I'm wrong about that.)

2) I would think that this resizing paradigm should include all measurements, including the ones used for offsets. Is that correct?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Hanging Paragraph output issue

Post by LTinker68 »

QuadraQ wrote:1) How would I properly translate the text sizes I have currently into percentages for non-print output? (I'm assuming the font sizes should be moved into the print medium section of the css - correct me if I'm wrong about that.)
It's really up to you, but for example, you can set the body tag in the default medium to 80% or .8 ems (same thing) and set the paragraph tag to 100% or 1.0em. I think Dave Lee wrote somewhere else in the forums that a body font size of 100% or 1 em was about equal to 16 pixels or something like that, but the default value (16 px) is defined in the browser, so it may go up or down slightly depending on what browser you're looking at. It also depends a bit on what font/font family you're using. For instance, we use Verdana because you can go a lot smaller on the font size (e.g., 8px) and still have it be readable, whereas Arial starts to lose readability if you go below 10px. Ideally, you should do some usability studies with a sampling of your target audience, but who has time to do that. :wink:
QuadraQ wrote:2) I would think that this resizing paradigm should include all measurements, including the ones used for offsets. Is that correct?
Ok, Scott DeLoach, if you're hanging around, check me on this... As I recall, Scott recommended that for online output you should use proportional sizing (ems or %) only on font sizes so that your users have the option to adjust the font size to suit their needs. Any positioning attributes (margins, padding, etc.) should use pixels, because you usually want to be more precise on the positioning. That said, if you're overlapping elements (via DIVs with z-index values specified), be aware that resizing of the font sizes may create havoc with the overlapping.

For print output, use points for font sizes, and use points or inches (or cm or mm or whatever) for positioning attributes.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Re: Hanging Paragraph output issue

Post by QuadraQ »

I realize we've gotten way off topic here, but I'm fascinated. I had no idea it worked like this!

OK so I've been playing around, and found that the body class has a default font size of 70%. That would be the same as 0.7em if I understand you correctly. Just playing around I found that a font size of 122% for a paragraph class that I have using Times New Roman, ends up equaling 11 points - it even shows up as such in the editor in Flare.

What I don't understand is why 70% is the default font size for the body in Flare. Wouldn't it make more sense for it to be 100%?

I found a website here http://pxtoem.com/ that seems to indicate that is the browser default. Am I missing something?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Hanging Paragraph output issue

Post by LTinker68 »

The browser default size is 16px or thereabouts, depending on what the browser manufacturer set it to be. So IE's default size may be (probably is) different from Firefox which could be different from Safari and so on.

You can set the body tag to 100% or 1 em, but personally, I think that's too large. So I set the body tag to .8 em (don't ask me why, but I prefer em to %). Due to the "cascading" in cascading stylesheets, if I were to set the paragraph tag, for instance, to .8 em, then the resulting font size of paragraphs would be .64 em, because .8 (80%) of .8 is .64. So, I set my paragraph tag and similar level tags (div, ol, ul, blockquote, etc.) to 1.0 em, so the resulting font size of a paragraph would be .8 em ( .8 x 1 = .8 ). If I were to have a "note" paragraph and I wanted it to be slightly smaller than a normal paragraph, then I might set its value to .8 em. That doesn't mean it's the same size as the body tag (.8 em). That's where things can get a bit tricky with cascading stylesheets. Since p.note is a child of <p> and a grandchild of <body>, its actual font size will cascade down to a relative size of .64 em [.8 em (p.note) x 1.0 em (p) x .8 em (body) = .64 em]. Conversely, if you wanted the note paragraph to be bigger than a normal paragraph, you might set its font size to 1.2 em, so that it's about 20% larger than a normal paragraph. Heading tags in particular are often set to over 100% or over 1 em.

Quite frankly, just looking at numbers like that is very hard to judge what the resulting font sizes will be. So I do a lot of testing of the font sizes as I set up styles. That is, I build the output and look at it. I rarely go below .7 em on anything, and that's because I use Verdana. But you'll have to judge to see what works best for you and more importantly, your users.

BTW, if you have to worry about being 508-compliant, then you have to use relative font sizes for online output.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Re: Hanging Paragraph output issue

Post by QuadraQ »

Well I've found that setting the body to 100% makes it a little easier for me to follow, although from what I can understand it's all relative (ha ha :) )

The sad thing is that I'm moving my non-print medium to using relative measurements for font size and pixels for offsets as suggested, and it still doesn't fix the problem I started the thread about. I think something is wrong here, because it's behaving as if the top padding is simply being ignored. I think I'll have to submit this to MadCap for review.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Hanging Paragraph output issue

Post by LTinker68 »

QuadraQ wrote:The sad thing is that I'm moving my non-print medium to using relative measurements for font size and pixels for offsets as suggested...
Honestly, I wouldn't bother using the non-print medium. It has no particular use as far as I can see.

It could be that you're still making changes in the wrong medium or it could be that there is something else wrong. Maybe this will help...

Styles declared only in the default medium:
  • All outputs will use the styles in the default medium, regardless of what is specified in the targets.
Styles declared in the default and print mediums:
  • Online outputs will use only the styles in the default medium.
  • If a print target is set to use the "print" medium (default setting in the target), then it will use the styles in the print medium first, and if a style isn't found there, will use the style definition in the default medium.
  • Printing from an online output will use the styles in the print medium.
Styles declared in the default, print, and printBook (custom) mediums:
  • Online outputs will use only the styles in the default medium.
  • If a print target is set to use the "print" medium, then it will use the styles in the "print" medium first, and if a style isn't found there, will use the style definition in the default medium.
  • If a print target is set to use the "printBook" custom medium (or whatever you called the custom medium), it will use the styles in the "printBook" medium first, and if a style isn't found there, will use the style definition in the default medium.
  • Printing from an online output will use the styles in the "print" medium.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Re: Hanging Paragraph output issue

Post by QuadraQ »

What I mean is moving things like font size in points and measurements in inches to the print medium as overrides for those values in the default (non-print) medium, where they are represented as percentages or em and pixels respectively.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Hanging Paragraph output issue

Post by LTinker68 »

I don't think I'm quite getting what you're asking, but I often copy a style definition in the default medium then copy it into the appropriate print medium, remove any attributes that are the same in print as they are in the default, then modify the value of any attributes that are supposed to be different from the default medium. So if I have a p.Note class that has a font size of .8em set in the default medium, then I'll modify (or set via the Stylesheet Editor) the attribute in the print medium to be 10pt, for example.

If you're asking what .8em is equal to in points, there isn't a straight conversion available, because .8em is proportionate to whatever the parent tag is, so it's not a definite value. Pixels to points is almost a straight 1:1 conversion. Not quite, but fairly close. But there is no straight conversion from em/percents to points/inches. Just go with what looks good in the print medium. Or if your company has a set of standards for its print documents.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Re: Hanging Paragraph output issue

Post by QuadraQ »

LTinker68 wrote:... So if I have a p.Note class that has a font size of .8em set in the default medium, then I'll modify (or set via the Stylesheet Editor) the attribute in the print medium to be 10pt, for example.
That's exactly what I'm doing. Just remember that I didn't understand all this until recently (thank you), so I had everything defined as points (print, default, everything). As you say there's no straight conversion, so I'm having to use some trial and error to develop equivalents.

Here's an example:

Code: Select all

p.CPText
{
	font-family: 'Times New Roman';
	font-size: 91.6%;
	margin-bottom: 0.75em;
	mc-hyphenate-shortest-word: 6;
	mc-hyphenate-shortest-prefix: 3;
	mc-hyphenate-shortest-suffix: 3;
	mc-hyphenate-maximum-adjacent-line-count: 0;
	mc-auto-number-format: '{ =0}';
}

@media print
{
	p.CPText
	{
		font-size: 11pt;
	}
}
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Re: Hanging Paragraph output issue

Post by QuadraQ »

Just got word from MadCap support.

I don't know why this is so, but replacing the "padding-top: -5px;" property in the span class used for the word "Purpose:" with "margin-top: -5px;" fixes it for web based output.
forfear
Propellus Maximus
Posts: 766
Joined: Sat Feb 16, 2008 3:37 am
Location: Jungle Jingles

Re: Hanging Paragraph output issue

Post by forfear »

not sure if this is any relevance there was some discussion about EMs and relative point sizing for this one.

http://forums.madcapsoftware.com/viewto ... ice#p30467
If you submit your bug feedback request here, the more likely it'll get fixed or included in a future release
Open Utilities PageLayout Resizer for Flare/Blaze | Batch builder
Post Reply