[Libreoffice-bugs] [Bug 144542] [DOCUMENTATION] Please describe line spacing in detail

2021-10-02 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=144542

--- Comment #7 from Rafael Lima  ---
Created attachment 175459
  --> https://bugs.documentfoundation.org/attachment.cgi?id=175459&action=edit
Macro that Loads all font metrics V2

Luke, I uploaded a new version of that Calc file with the macro. Now it returns
the style and calculates the ILG factor using the formula you provided.

Beware that to run it, you should use LO 7.1 or higher. The name of the macro
is "LoadFontInfo".

I believe LibreOffice does some rounding after applying the factor, but I am
not an expert in font rendering. Maybe we'll need feedback by someone else to
confirm if (and how) rounding is applied.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 144542] [DOCUMENTATION] Please describe line spacing in detail

2021-10-02 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=144542

--- Comment #6 from Luke Kendall  ---
Sorry, where I wrote:

"Hmm: assuming the calculation would be:
Inter Line Gap factor = Leading / (Height + Descent)
Inter Line Gap factor = Inter Line Gap factor * Font size"

I meant to write:

"Hmm: assuming the calculation would be:
Inter Line Gap factor = Leading / (Height + Descent)
Inter Line Gap = Inter Line Gap factor * Font size"
  ^_

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 144542] [DOCUMENTATION] Please describe line spacing in detail

2021-10-02 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=144542

--- Comment #5 from Luke Kendall  ---
It was a real battle to get Calc to let me run the macro.

Initially, the file opened with a warning that untrusted macros wouldn't be
run.
I then navigated via Tools->Macros->Run Macro to navigate to the AllFontMetrics
macro and select Run.
Nothing at all happened - no warning that it couldn't run, but no indication
that it was running, either. [1]

Next I tried clicking on the button, with the same result.

Then I opened Tools->Macros->Edit Macro and navigated again to the LoadFontInfo
macro and selected Run. This time it immediately failed with a message on an
error panel [containing text that can't be copied and pasted, which is
annoying][2]:
For security reasons, you cannot run this macro.
For more information, check the security settings.

I did that, and changed my security settings for macros from high to Low, and
hit OK.
I tried again, and got the same security error.

I closed the file and reopened it, and checked that the macros security option
was still set to Low, and tried again, and got the same security denial.

In desperation, I exited from LibreOffice entirely and restarted.
At that point it worked.

So neither 
(1) the message about the security setting, nor 
(2) changing the security settings and applying/okaying the change
prompted the user that the changes would not take effect until exiting and
restarting LibreOffice entirely. [3]

I don't have time to report items [1], [2], and [3] as bugs.

Anyway, checking into my specific case to try to give Rafael some useful
information, it's not at obvious how to use the information I see.

Since I know a bit about font design and typesetting, I'll see if I can puzzled
it out here...

I typically set my 5"x8" format books using 10.5pt Georgia.
It seems possible that it uses a line height of 12pt (so I suppose you could
say a leading of 1.5pt), if my guess is right.
Now, the info provided doesn't include the typeface 'style', so I simply get
the name Georgia repeated four times (no indication of Regular, Italic, Bold,
Bold Italic), although in this case it doesn't matter because all the metrics
are the same for each of the four.
To be concrete, I get:

NameHeight  Ascent  Descent Leading Slant
...
Georgia 17  16  4   3   0
Georgia 17  16  4   3   0
Georgia 17  16  4   3   0
Georgia 17  16  4   3   0

Hmm: assuming the calculation would be:
Inter Line Gap factor = Leading / (Height + Descent)
Inter Line Gap factor = Inter Line Gap factor * Font size
yields 3 / (17+4) = 1/7 for the Inter Line Gap factor
and 10.5pt/7 -> 1.5000pt
Which does indeed give me the answer I would expect in this example at least,
so I think you may have solved the problem Rafael - thank you!

So, Writer could look up those metrics for the font style and height selected
for a paragraph style, and report that information as a read-only figure on the
Indents & Spacing tab for the Paragraph Style panel.

I assume the Line Height number reported would have to be modified by a
multiplying factor if one was included in the paragraph style (like 1.15, 1.5,
Double spacing) was selected, or by an addition if some additive factor was
chosen as the Line Spacing in the Indents & Spacing tab; or copied from the
user selected figure if Fixed was selected, or just use the Leading factor if
the user selected that?

Doing a quick comparison with Times New Roman, which my 'rule of thumb'
learnings have said is usually set as if Line Height is 1pt larger than the
font size (so, 10/11, 11/12, 12/13) is roughly right:
The metrics give 2/21 as the inter line gap factor, so would give 10/10.95,
11/12.05, 12/13.14. (I remember that this changes to Size/Size+2 at some point
around 15pt - and so on as the font size increases further - but can't remember
exactly where.)

I don't know whether Writer rounds the line heights to integer values or works
with fractional line heights as it lays out lines of text on the page. That's
an important fact important to know, too, but is easily handled by reporting
the figure with two or four decimal digits of precision if it uses fractions,
otherwise as whole number if it rounds.

Note:
I understand that when the writer uses superscripts, inserts larger text, or
images etc. in a line, it must increase the leading for such lines - but the
user should also understand the such text layout changes may alter the number
of lines that will fit on such a page. Therefore I think that issue isn't
something Writer could be reasonably expected to do much about. I.e. the
normal-case Line Height figure is enough.

---

Just a final note on the font naming thing: it would be important for the
Regular/Italic/Bold/... font style used in the paragraph style to be looked up
as the basis for the calculations, if the feature is added to Writer. If it's
not added, it would be good if the font style could be appended (in s

[Libreoffice-bugs] [Bug 144542] [DOCUMENTATION] Please describe line spacing in detail

2021-10-01 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=144542

--- Comment #4 from Rafael Lima  ---
Created attachment 175444
  --> https://bugs.documentfoundation.org/attachment.cgi?id=175444&action=edit
Macro that Loads all font metrics

@Luke... I created a Calc sheet with a macro (just click the button on it) that
loads the Font Metrics of all fonts available in your system. This include
metrics as Leading, Ascent and Descent.

Beware that if you have a lot of fonts, it will take a few minutes to finish
loading. On my PC with 8 thousand fonts, it took 5 minutes.

Could you please verify if this information would help you determine line
height?

If so, let me know because I'll create the corresponding documentation. And
maybe add this macro to one of the built-in LO macros.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 144542] [DOCUMENTATION] Please describe line spacing in detail

2021-09-29 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=144542

--- Comment #3 from Rafael Lima  ---
@Regina, can this information be found anywhere using a macro? Which property
of a Paragraph or TextPortion would store this information? I did my best
trying to find it, but was not successful.

I was trying to instantiate the Canvas service [1] to get a "XCanvasFont"
object [2] and call its getFontMetrics() object. Maybe this would reveal the
desired information.

This would return a FontMetrics struct [3] which contains information about
leading. However, I was not successful instantiating the Canvas service through
a macro, so the method was unreachable.

[1]
https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1rendering_1_1Canvas.html

[2]
https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1rendering_1_1XCanvasFont.html

[3]
https://api.libreoffice.org/docs/idl/ref/structcom_1_1sun_1_1star_1_1rendering_1_1FontMetrics.html

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 144542] [DOCUMENTATION] Please describe line spacing in detail

2021-09-27 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=144542

--- Comment #2 from Luke Kendall  ---
Yes, but I haven't found clear documentation on 'register true' either, and I
don't think it helps in making the calculation. I'm guessing I'd still need to
just try it out on a reasonably long (ipsem lorum) document to see whether or
not there was a spill on page 50 or 100 or 200, and would have to visually
inspect every page to spot an occurrence.

Based on your response and thinking about it some more, I appreciate that it
would of course depend on the font, and potentially the font size within that
font too. But Writer must know the values (since it does the
typesetting/layout), then providing some way for the user to actually discover
the numbers would be enough - that way at least they could perform the
calculations.
I guess the info would also have to include how subscripts and superscripts
might change the numbers if the user happened to use them, too.
The trouble is that at the moment it's a total black box and the user has no
information other than how the text is laid out on the page in the end.

>From what you've said though Regina, I should change this from a request for
more documentation (which can't really provide it), into an enhancement request
for Writer to provide this info somehow?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 144542] [DOCUMENTATION] Please describe line spacing in detail

2021-09-20 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=144542

Xisco FaulĂ­  changed:

   What|Removed |Added

 CC||olivier.hallot@libreoffice.
   ||org,
   ||xiscofa...@libreoffice.org
  Component|Writer  |Documentation

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Libreoffice-bugs] [Bug 144542] [DOCUMENTATION] Please describe line spacing in detail

2021-09-16 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=144542

Regina Henschel  changed:

   What|Removed |Added

 CC||rb.hensc...@t-online.de

--- Comment #1 from Regina Henschel  ---
It is not such easy because leading depends on the font too, especially whether
it is a modern font, that includes some information about line spacing.

Have you considered to use "Page line-spacing" (in the past named
'Register-true')?

-- 
You are receiving this mail because:
You are the assignee for the bug.