Font Listing
Vbscript way to list fonts?
Saturday, December 16, 2006 by RomanDA | Discussion: DesktopX
Does anyone know if there is a way to accomplish this in DX (VBScript)?
Thanks in advance!
Reply #2 Saturday, December 16, 2006 12:30 PM
But, I'm looking for VBscript "CODE" that i can use inside of a gadget I'm creating in DX. It would need to use VBScript to generate a listing i can then put into a drop down.
Reply #3 Saturday, December 16, 2006 5:18 PM
If i would have looked in the preferences in the reference!
Set objBOX = DesktopX.CreateForm
With objBOX
.caption = " DesktopX Form Name... "
.addpreference("Font")
.preference("Font").Type = "Font"
.preference("Font").caption = "Font Name"
End With
Set objBOX = nothing
You gots to love things.. GOOGLE IS THE BEST!!
Reply #4 Saturday, December 16, 2006 6:28 PM
| GOOGLE IS THE BEST!! |
...don't say that so loud, around here.
They'll come & take you away...
Reply #5 Saturday, December 16, 2006 7:24 PM
and there it was.. should have thought of that first!
Reply #6 Wednesday, January 3, 2007 8:28 AM
I found your message right now. No any problems! Please look below:
'This code can do all that you want.
Sub FontChanger()
On Error Resume Next
fsize = Array("8","9","10","11","12","14","16")'etc... <== the array ao font sizes
Set objBOX = nothing
Set objBOX = DesktopX.CreateForm
With objBOX
.caption = " RomanDA's Font Changer "
.addpreference("FONT") '<== All of installed fonts you will see here
.preference("FONT").Type = "font"
.preference("FONT").defaultvalue = "Arial"
.preference("FONT").caption = "Change a Font: "
.addpreference("SIZE") '<== Applying the values of "font sizes" to the Combolist items
.preference("SIZE").Type = "combolist"
For Each sz In fsize '<== extracting data from the array
.preference("SIZE").addvalue sz
Next
.preference("SIZE").defaultvalue = "8"
.preference("SIZE").caption = "Change Font Size: "
.addpreference("BOLD") '<== check box for "Bold"
.preference("BOLD").caption = " Bold"
.preference("BOLD").Type = "checkbox"
.preference("BOLD").defaultvalue = False
.addpreference("ITALIC") '<== check box for "Italic"
.preference("ITALIC").caption = " Italic"
.preference("ITALIC").Type = "checkbox"
.preference("ITALIC").defaultvalue = False
.addpreference("COLOR") '<== Color Changer
.preference("COLOR").Type = "color" 'the current color of your textobject
.preference("COLOR").defaultvalue = desktopx.object("YOUR TEXT OBJECT").textcolor
.preference("COLOR").caption = "Set a Font Color: "
If .prompt Then
VALUE1 = .preference("FONT").value
VALUE2 = .preference("SIZE").value
VALUE3 = .preference("BOLD").value
VALUE4 = .preference("ITALIC").value
VALUE5 = .preference("COLOR").value
'* Aplying new font properties
desktopx.object("YOUR TEXT OBJECT").setfont VALUE1, VALUE2, VALUE3, VALUE4, 0,0,0
'* Aplying new font color
desktopx.object("YOUR TEXT OBJECT").textcolor = VALUE5
End If
End With
Erase fsize
Set objBOX = nothing
If err.number > 0 Then err.clear
End Sub
Sorry my friend that I can't help you much powerful yet...
Best Regards.
Reply #7 Wednesday, January 3, 2007 9:12 AM
Thanks, I found these same Pref's the other week. I actually was looking to do this in a custom made window. I found some code to read the registry and list out the fonts, its not super fast, but it works good.
I'm really close to making this all work, its been a lot of work, but its close.
I made code to do pretty much everything here, except the COLOR, i am using a popup window to do this, i might change to do the font the same way, because its very slow.
This is what my EDIT box looks like for the Holiday Countdown PRO (its not 100% yet).

Thanks for the input!
Reply #8 Friday, January 5, 2007 5:19 AM
Looks like it's going great DA. Keep up the good work.
BTW: how's that logo contest going? I whipped these out the other day and thought I might as well show 'em to you.

Reply #9 Friday, January 5, 2007 4:52 PM
Its going, but i cant see the images you posted.
Yeah, that script helps, but its not what i needed for this gadget.
Reply #13 Saturday, January 6, 2007 6:12 PM
v.3

v.4 (minute difference w/ less bevel)

Reply #14 Monday, February 5, 2007 5:05 PM
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Strange.

Reply #1 Saturday, December 16, 2006 11:38 AM
Font Lister