Page 1 of 1

Line height and Special Character > Spaces . . .

Posted: 2011-11-23 18:30:43
by goldste4
Hello All,

I noticed that when I add some of the special character spaces such as thin space, hair space, non-breaking zero width space (but NOT the non-breaking space), the height of the line with that special character space visually increases by what look a point or two (although the actual line height number in the paragraph palette does not show any change).

I first noticed this with Adobe type faces, but have tried it with Apple ones too, and noticed the same thing.

Just to illustrate, I've attached two screen shots: the bottom one with no special character spaces; the top one with a non-breaking zero space inserted within the word 'loyalty' (with the red underline). You can see the difference in line height that the special character space introduces.

Any work-arounds would be appreciated!

Josh

Re: Line height and Special Character > Spaces . . .

Posted: 2011-11-24 01:26:16
by Elbrecht
Hi -

I would guess that your "non-breaking zero space" is NOT part of ANY font - how to display a "zero space" anyway? This "zero space" is handled by the text engine concerned only - with different results for different text engines.

You should not use the standard "Multiple Line Spacing" - go "Fixed Line Spacing" for all your documents instead. That does the trick…

HE

Re: Line height and Special Character > Spaces . . .

Posted: 2011-11-24 13:28:09
by goldste4
Hello Elbrecht,

Thanks very much, that does indeed do the trick!

Josh

Re: Line height and Special Character > Spaces . . .

Posted: 2011-11-28 14:04:46
by martin
I'm glad Elbrecht's suggestion of using a fixed line spacing does the trick for you Josh. Another solution (that's perhaps less convenient): adjust the font size for the zero-width spaces to be smaller.

The problem here, as Elbrecht implied, is indeed font substitution. Whatever font you're using (eg: Times), likely technically doesn't contain the zero-width space, so the text system substitutes another font. That substituted font (perhaps Lucida Grande) has a larger natural line height, so your line height is expanded. This is a bit of an annoyance, because one doesn't really care about the height of any space, but it's the way the Apple text engine works. Maybe there's something we can do to augment this process; I'll file it as something to investigate.

Re: Line height and Special Character > Spaces . . .

Posted: 2011-11-29 10:20:38
by goldste4
Hi Martin, thanks for the alternative solution, appreciate it. Josh

Re: Line height and Special Character > Spaces . . .

Posted: 2011-11-29 10:30:38
by Elbrecht
Hi Martin -

how do you select a "zero-width space" to handle - I wonder…

HE

Re: Line height and Special Character > Spaces . . .

Posted: 2011-11-29 11:04:35
by martin
Elbrecht wrote:how do you select a "zero-width space" to handle - I wonder…
That's true, zero-width characters are a bit tricky to select. Generally the keyboard works best:

1. Click on the zero-width space to move the insertion point to coincide with the space. Of course, the insertion point isn't exactly on the zero-width space, it's either just before the space, or just after the space.
2. Figure out whether the insertion point is to the left or right of the zero-width space by pressing the left/right arrowkey once. If the insertion point actually changes position (ie: by jumping a normal visible character), you know that you moved the insertion point the wrong way. If the insertion point did not change its position, you know that you just jumped the zero-width space; this is what you want.
3. After you figured out which arrowkey to press to jump the space, now press the opposite arrowkey (left vs right) while holding down the Shift key. If you did it right, the zero-width space should now be selected (though you won't see such a selection on screen).

Another tactic that is easier to describe/understand:

1. Place the insertion point on the left side of the character before the zero-width space. For example, if your text is just "ab", and the zero-width space is between the "a" and the "b", then place the insertion point to the left of the "a".
2. Press the right arrowkey once. This moves the insertion point to the right of the "a", just before the zero-width space.
3. Hold down the Shift key and press the right arrowkey again. You should now have the zero-width space selected.

Or if you have a bunch of these zero width spaces you want to adjust at once, using Find All would be best.

Re: Line height and Special Character > Spaces . . .

Posted: 2011-11-29 11:21:21
by Elbrecht
Fine, fine Martin -

but to get the font used for "zero-width space" displayed the NWP "Font Tool" is of no use, is it?
System wide "Format/Font/Show Fonts" will do the job. Yes you are right - it is Lucida Grande…

HE

Re: Line height and Special Character > Spaces . . .

Posted: 2011-11-29 11:47:30
by martin
Elbrecht wrote:but to get the font used for "zero-width space" displayed the NWP "Font Tool" is of no use, is it?
You can use the NWP font menus to figure out the substituted font. Once you have the space selected, look on the menu Format > Font > All Fonts. There should be dashes (tick marks) next to two font names, both the original and the substitution font. The original font name (the one that could not be used) will be highlighted in orange (or whatever color you have chosen in your NWP preferences), while the substitution font name (the one that was used instead) will appear as normal (in black).

Or, a macro like this:

Code: Select all

$doc = Document.active
$selected = $doc.textSelection

If $selected.length > 0
	$text = $selected.text
	$location = $selected.location

	$attrs = $text.attributesAtIndex($location)
	$displayAttrs = $text.displayAttributesAtIndex($location)
	If $displayAttrs.isFontSubstituted
		$origFont = $attrs.fontName
		$usedFont = $displayAttrs.fontName
		Prompt "Original Font: $origFont \nDisplay Font: $usedFont"
	Else
		Prompt "No font substitution occurred."
	End
End

Re: Line height and Special Character > Spaces . . .

Posted: 2011-11-30 00:43:20
by Elbrecht
Hi Martin -

thanks for the show - I got used to work with the System Fonts Fool in NWP over the years. That's the way to go with more complex font families - and now even with the "zero-width space" character! A "character" I never had to use before - but it is essential for getting the complex writing systems to combine correctly…

HE