[Solved] Creating a list of fonts

Discuss setup / installation issues - Add a spell checker, Language pack?

[Solved] Creating a list of fonts

Postby adityavpratap » Sun Dec 20, 2009 9:51 am

Hi!

I have been using OpenOffice.org on Linux for some time now. I have found it very useful.

I need to create a list of available fonts. Suppose there are x number of fonts available, I want to create a document containing a line of text displayed in all the available fonts. The manual way of doing it is too tedious, so is there any way of creating such a document automatically?

Thanking in advance,

Aditya Pratap V.
Last edited by Hagar Delest on Sun Dec 20, 2009 1:35 pm, edited 1 time in total.
Reason: tagged [Solved].
Aditya Pratap V.
OpenOffice.org 3.1 + Ubuntu
adityavpratap
 
Posts: 12
Joined: Fri Sep 12, 2008 4:56 pm

Re: creating a list of fonts

Postby RoryOF » Sun Dec 20, 2009 10:21 am

http://opcion.sourceforge.net/ might do what you require.
Apache OpenOffice 4.1.7 on Xubuntu 20.04.1 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 31409
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: creating a list of fonts

Postby Robert Tucker » Sun Dec 20, 2009 10:30 am

For all the fonts available on your Linux system:

Code: Select all   Expand viewCollapse view
$ (echo '<html><body>' && (fc-list | sed 's/\(.*\):.*/<font face="\1">\1<\/font><br>/') && echo '</body></html>') > fonts.html
$ firefox fonts.hml


http://www.codealpha.net/66/print-insta ... each-font/

Otherwise you might have a look at using Python (don't know if Basic will do the same thing) with a list of fonts you have created from the directories you know OpenOffice can access and edited into the form:

Code: Select all   Expand viewCollapse view
cursor.setPropertyValue("CharFontName", "Arial")
cursor.setPropertyValue("CharWeight", 150)
document.Text.insertString(cursor, "\n\nThis is bold Arial."
cursor.setPropertyValue("CharFontName", "Times New Roman")
cursor.setPropertyValue("CharWeight", 150)
document.Text.insertString(cursor, "\n\nTimes New Roman."
etc
etc

http://www.devshed.com/c/a/Python/Pytho ... ficeorg/2/
LibreOffice 6.x.x on Fedora 32 and Ubuntu 20.04 (Dual Boot)
User avatar
Robert Tucker
Volunteer
 
Posts: 1247
Joined: Mon Oct 08, 2007 1:34 am
Location: Manchester UK

Re: creating a list of fonts

Postby adityavpratap » Sun Dec 20, 2009 10:42 am

Robert Tucker wrote:For all the fonts available on your Linux system:

Code: Select all   Expand viewCollapse view
$ (echo '<html><body>' && (fc-list | sed 's/\(.*\):.*/<font face="\1">\1<\/font><br>/') && echo '</body></html>') > fonts.html
$ firefox fonts.hml


http://www.codealpha.net/66/print-insta ... each-font/


Thanks a lot! So it creates a html file that can be opened in a web-browser. That's convenient! I can then copy all the text from the browser into OOo writer of directly convert the webpage to pdf using the Print to file option. Thanks a lot once again.
Aditya Pratap V.
OpenOffice.org 3.1 + Ubuntu
adityavpratap
 
Posts: 12
Joined: Fri Sep 12, 2008 4:56 pm

Re: creating a list of fonts

Postby Robert Tucker » Sun Dec 20, 2009 10:48 am

adityavpratap wrote:Thanks a lot! So it creates a html file that can be opened in a web-browser. That's convenient! I can then copy all the text from the browser into OOo writer

Yes, but I think you will find it's more of a list of all the fonts on your system – some/many may not be available to OpenOffice, particularly some of the system fonts.
LibreOffice 6.x.x on Fedora 32 and Ubuntu 20.04 (Dual Boot)
User avatar
Robert Tucker
Volunteer
 
Posts: 1247
Joined: Mon Oct 08, 2007 1:34 am
Location: Manchester UK

Re: [Solved] Creating a list of fonts

Postby adityavpratap » Sun Dec 20, 2009 4:54 pm

Oh!
Then is there a way to do it from within OOo?
adityavpratap
 
Posts: 12
Joined: Fri Sep 12, 2008 4:56 pm

Re: [Solved] Creating a list of fonts

Postby acknak » Sun Dec 20, 2009 9:15 pm

I've used this macro from Andrew Pitonyak: http://www.pitonyak.org/AndrewFontMacro.odt

It generates a Writer document with a sample of every font available to OOo.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Solved] Creating a list of fonts

Postby Star_Gazer » Tue Apr 13, 2010 5:49 pm

acknak wrote:I've used this macro from Andrew Pitonyak: http://www.pitonyak.org/AndrewFontMacro.odt

It generates a Writer document with a sample of every font available to OOo.


I downloaded the AndrewFontMacro.odt file, and cannot get the Macro to run. How does one get that macro to work?
I would like to have the fonts listed in their original styles - the html method provided above just does the 'regular' styles and has a lot of duplicates that looks the same, respectfully.

Regards,
Clifton
LibreOffice.org 3.3.* | openSUSE 11.4 KDE
Star_Gazer
 
Posts: 12
Joined: Tue Apr 13, 2010 3:06 am

Re: [Solved] Creating a list of fonts

Postby acknak » Tue Apr 13, 2010 6:56 pm

The font list macro in that document works fine for me.

You just have to open the document, scroll down to the section you want (2: "Formatted font summary") and click on the button to run the macro.

Note: OOo's normal security settings should prevent you from running macros. You will need to change the settings under Tools > Options > OO.org > Security > Macro Security to allow macros to run.
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Solved] Creating a list of fonts

Postby Star_Gazer » Tue Apr 13, 2010 8:54 pm

acknak wrote:The font list macro in that document works fine for me.

You just have to open the document, scroll down to the section you want (2: "Formatted font summary") and click on the button to run the macro.

Note: OOo's normal security settings should prevent you from running macros. You will need to change the settings under Tools > Options > OO.org > Security > Macro Security to allow macros to run.


Yes ... Yes! All is good now, and now I have got my listing. Just the Regular ones too, without all the other ones of the family (Italic, Bold, etc.) just as I prefer.

A many thanks! :super:

Yesterday, I could not get that button to work.

Thanks,
Clifton
LibreOffice.org 3.3.* | openSUSE 11.4 KDE
Star_Gazer
 
Posts: 12
Joined: Tue Apr 13, 2010 3:06 am


Return to Install, Setup and Troubleshooting

Who is online

Users browsing this forum: No registered users and 3 guests