[Solved] Changing the font size in a comment box....

Discuss the drawing application
Post Reply
jrickert
Posts: 4
Joined: Tue Oct 05, 2021 11:56 pm

[Solved] Changing the font size in a comment box....

Post by jrickert »

Solved I can't change the font size once I put something into a comment box. How is it done? I am using Linux Mint Cinnimon.
Last edited by robleyd on Fri Oct 08, 2021 12:07 am, edited 2 times in total.
Reason: Tag [Solved]
OpenOffice 2.4 on Ubuntu 9.04
User avatar
Zizi64
Volunteer
Posts: 11360
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Changing the font size in a comment box....

Post by Zizi64 »

I am using Linux Mint Cinnimon.
_______________________________________
OpenOffice 2.4 on Ubuntu 9.04
Which version of the AOO/LO are you using really? Please update your signature in this forum.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
Posts: 11360
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Changing the font size in a comment box....

Post by Zizi64 »

I can't change the font size once I put something into a comment box.
Please upload your ODF type sample file here.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Changing the font size in a comment box....

Post by RoryOF »

I can't say about comments for Draw (not tested), but in Writer, if one selects the text in a Comment, one can change the typeface and type size using the font and size selector on the Formatting toolbar. Be aware that such changes are not always permitted immediately as the file is being scanned and analysed in the background; what happens in a small file (few pages) may not be immediately possible to apply in a larger (book-sized) file. Typically a size change is allowable sooner than a font change.
 Edit: I have now had time to do a quick test. I found no way to easily change type size or font in a Draw Comment. That is not to say that there may not be a convoluted way to do so, but I have not explored that path. My remarks ((above) about Comments in Writer are still valid. 
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
jrickert
Posts: 4
Joined: Tue Oct 05, 2021 11:56 pm

Re: Changing the font size in a comment box....

Post by jrickert »

My version number for LibreOffice is 7.2.1.2. Does that help?
OpenOffice 2.4 on Ubuntu 9.04
User avatar
Zizi64
Volunteer
Posts: 11360
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Changing the font size in a comment box....

Post by Zizi64 »

A workaround tip:

Try to edit (format) the text of the Comment in an another object: set the desired properties (Bold, character size, italic, etc...)
then copy-paste the formatted text into the Comment box. Use the Format - Characters menu item in the other object.

The pasted format properties will be applied the more text what you type in into the specific Comment box.
Draw formatted comment text..odg
(9.98 KiB) Downloaded 282 times
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
Posts: 11360
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Changing the font size in a comment box....

Post by Zizi64 »

...and please update your signature in this forum:

User Control Panel - Profile TAB - Edit Signature SubTAB: type-in which version are you using really. it will appeared under your posts automatically, and the helpers can try to solve the problem in same version.
Last edited by Zizi64 on Thu Oct 07, 2021 3:20 pm, edited 1 time in total.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Changing the font size in a comment box....

Post by Lupp »

(I seriously doubt if there can be a way to do what the questioner asked for.)

I was using Draw not like a "professional", but rather often for two decades now, and I never found a reason to insert a "Comment". I even didn't know (ever looked for) a menu item for the purpose.

In pursuit of this question, however, I tried to find related API objects (a service mainly) handling "Comments" in drawings. Neither searching for Comment nor searching for Annotation (which is the API name for the thing used in Writer or Calc context) lead to a result.

Can anybody help me with my search?
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Changing the font size in a comment box....

Post by RoryOF »

@Lupp: there is information on Annotations at

https://www.openoffice.org/api/docs/com ... ation.html

but nothing that I can find specific to Draw. The above mentions that they can be attached to a TextField, which may in Draw be the Page (I haven't checked - I''m in the middle of another project).

The above information can be used in Writer - I use Annotations/Comments all the time in Writer, driven by a set of macros based on the above, with a false author, such as "Revised", "Check" etc, to keep track of revisions and other matters in the writing of a long document.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Zizi64
Volunteer
Posts: 11360
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Changing the font size in a comment box....

Post by Zizi64 »

and I never found a reason to insert a "Comment".
+1
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Changing the font size in a comment box....

Post by Lupp »

RoryOF wrote:... there is information on Annotations at ...
Yes.
Thanks, but ...

Annotations in text documents are treated as a special kind of TextField. com.sun.star.text.textfield.Annotation is the respective service and each TextDocument has a container for all its textfields (enumerable; also inspectable with For Each ... Next). In addition any textfield can be detected as a zero-length-portion when scanning a text object for its portions.

Annotations in spreadsheet documents share the name and -partly- the feel. They are, however, treated very differently as a special kind of shapes. com.sun.star.sheet.CellAnnotationShape is the characteristic service. The objects are inserted into the .DrawPage of their sheet, and the sheet itself has even a specialized .Annotations container. The cell having an annotation assigned gives access to it, and the annotation knows to which cell it is anchored - and at the same time assigned as a .Annotation object.

For drawing documents I couldn't find anything of the kind. There seems to be no mention in the API reference. The annotation isn't found as selected (in the CurrentSelection) under any circumstances. None of the properties of the document model or of its drawpages is showing anything I would suspect to be related to annotations. The drawing document hasn't a .Text where the annotation might be anchored in . ...
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
cwolan
Posts: 129
Joined: Sun Feb 07, 2021 3:44 pm

Re: [Solved] Changing the font size in a comment box....

Post by cwolan »

@Lupp
I'm not entirely sure if what I found is what you're looking for...

The source code (AOO, LO) refers i.a. to ::com::sun::star::office::XAnnotation
In the IDL reference for AOO there is nothing indeed, however the LO's IDL Reference provides information on:

XAnnotation Interface
https://api.libreoffice.org/docs/idl/re ... ation.html

XAnnotationAccess Interface
https://api.libreoffice.org/docs/idl/re ... 0e3abce01d


It seems to work in LO and - surprisingly (?) - in AOO. See please the attached .odg file (button "SHOW").
Attachments
testANNO.odg
(10.15 KiB) Downloaded 269 times
OpenOffice 1.1.5 – 4.1.15
LibreOffice 3.3.0.4 – 7.6.6
Windows 7,10,11 64-bit
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: [Solved] Changing the font size in a comment box....

Post by Lupp »

@cwolan: Thanks a lot.
However that's really funny, and it enforces somehow my suspicions concerning the ways the "architecture" of LibO code is actually regarded by the development. (There were more relevant cases.)

Anyway, your solution to how to create enumeration for a container not existing as an object also allows for a solution to the questioner's problem:

Code: Select all

Sub setAllAnnotationsToNewCharHeight(Optional pPages As Long, Optional pMyPreferredCharHeight As Long)
Const prefCH = 40  REM Just for testing.
If IsMissing(pPages) Then pPages = - 2 REM Current page.
If IsMissing(pMyPreferredCharHeight) Then pMyPreferredCharHeight = prefCH
Select Case pPages
  Case -1 REM All pages.
    lo = 0 : u = ThisComponent.DrawPages.Count - 1
  Case -2 REM Current page.
    h = ThisComponent.CurrentController.CurrentPage.Number - 1
    lo = h : u = h
  Case Else REM Single page number (1-based) passed as argument. Reference to non-existing page is error.
    lo = pPages - 1 : u = lo
End Select
For j = lo To u
  j_pg = ThisComponent.DrawPages(j)
  j_AnnoEnum = j_pg.createAnnotationEnumeration()
  While j_AnnoEnum.hasMoreElements()
    oneAnno = j_AnnoEnum.nextElement()
    oneAnno.TextRange.CharHeight = pMyPreferredCharHeight
  Wend
Next j
End Sub
How to pass parameters to a Sub is not discussed here.
Spoken aside: How can people accept fonts representing the small l and the digit 1 by nearly identical glyphs?
Is there Natural Intelligence?
I replaced the original "l" for the code by "lo" to disambiguate. Being in a mood, you may read it as "ten" now.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Post Reply