Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OBrowser.execWB() to set font size
Message
De
07/03/2007 11:32:30
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Divers
Thread ID:
01201277
Message ID:
01201567
Vues:
39
>>I'm getting a weird result... the line spacing gets a few pixels larger or smaller when I flip this between 0 and 4, but the font stays the same. Could it be that stylesheet is affecting this? Maybe I should influence the fontsize of the body tag, and define all other styles as percentages of it?
>
>I tried it on Microsoft.com and it worked. However it doesn't work on UT because Michel set all the fonts/sizes in stylesheets.

Exactly. It works in Mozilla, even with stylesheets, but not in IE or its browser object. I eventually did this:
loDoc=loBrowser.Document
For Each loStyle In loDoc.stylesheets
	For i=0 To loStyle.rules.Length-1
		loRule=loStyle.rules(i)
		Lost=loRule.Style
		lcTag=loRule.selectorText
		lcSize=Evl(Lost.FontSize, "10px")
		lnSize=Val(lcSize)* tnSize
		lcUnits=Chrtran(lcSize,"0123456789.","")
		If NOT lcUnits = "%"
			lcSize=Alltrim(Transform(lnSize,"99999.99"))+lcUnits
			Lost.FontSize=lcSize
		Endif
	Endfor
Endfor
This is still not perfect, as two decimals seems to be not precise enough, so my increments (multiplying with 1.1 or 0.9) sometimes don't register, it rounds up to the same fontsize as before. I'll probably keep a collection of fontsizes per selectorText, and keep the unrounded numbers there.

(um... the "Lost" was supposed to be loST :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform