Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 11:23 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Change Font
PostPosted: May 13th, 2016, 6:29 pm 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Hi,

I would like to make an option in my HTML5 page that the user can change fonts and the font size.
Is it possible to add a Font Dialog?

Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Change Font
PostPosted: May 13th, 2016, 9:21 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
No - not in any practical sense. Depending on what text you need to change, you could consider displaying some items using the HTML object and applying CSS rules which you could change.

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Change Font
PostPosted: May 14th, 2016, 11:54 am 
Offline

Joined: May 16th, 2008, 4:50 pm
Posts: 368
Location: Berghem The Netherlands
Opus: Opus Pro 9.75
OS: Windows 10
System: `HP
Hi,

The font that i like to change is text in a variable. Can i make some font options to choose from.
Is that possible? Do i have to do that in a script file?

Ad

_________________
Opus Pro v9.75
Windows 10 on HP EliteBook i7
http://www.csnmedia.nl


For this message Ad Mulders has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Change Font
PostPosted: May 15th, 2016, 1:17 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
The basic code for changing the first variable in a standard textbox that I used was:

Code:
myTextbox = document.getElementById("websiteTBD_V1");
myTextbox.style.fontSize = "20px";
myTextbox.style.color = "red";
myTextbox.style.fontFamily = "Indie Flower";


1. This was run from a button with a JavaScript object.
2. The element in line one was identified by using the DOM explorer in Firebug.*
3. The Indie Flower font was present because I used it else where on the page.

*The name of the object in Opus was websiteTB. This normally means you are looking for the parent element id of websiteTBD (in this example). The actual child element with the piece of text to style (apply CSS) will vary.

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


For this message mackavi has been thanked by : Ad Mulders


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group