Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2004

Tip: Looking for answers? Try searching our database.

JEditorPane html font size

Thread view: 
Carina Ehrmann - 02 Feb 2004 16:28 GMT
Hello,

i want to display text with font size 30pt in a JEditorPane with the tag
"<font size="30pt">". But it is not displayed that big. How can i
display the text that big with the font size tag? Is there a limitation
for the size?

Thanks Carina
Christian Kaufhold - 02 Feb 2004 21:35 GMT
> i want to display text with font size 30pt in a JEditorPane with the tag
> "<font size="30pt">". But it is not displayed that big. How can i

Just wanting is not enough.

> display the text that big with the font size tag? Is there a limitation
> for the size?

RTFM: http://www.w3.org/TR/html4/present/graphics.html#edef-FONT

  size = cdata [CN]

  Deprecated. This attribute sets the size of the font. Possible values:

  An integer between 1 and 7. This sets the font to some fixed size, whose
  rendering depends on the user agent. Not all user agents may render all
  seven sizes.
  A relative increase in font size. The value "+1" means one size larger.
  The value "-3" means three sizes smaller. All sizes belong to the scale
  of 1 to 7.

You *can* use the style attribute:

<font style="font-size: 30pt">

Christian
Signature

And in short, I was afraid.

Andrew Thompson - 03 Feb 2004 03:47 GMT
"Christian Kaufhold" ...

> > i want to display text with font size 30pt in a JEditorPane with the tag
> > "<font size="30pt">". But it is not displayed that big. How can i
[quoted text clipped - 3 lines]
> > display the text that big with the font size tag? Is there a limitation
> > for the size?
...
>    size = cdata [CN]
>
>    Deprecated. This attribute sets the size of the font. Possible values:

I took particular interest in this post, since
I have been consulting the c.i.w.a.s groups
recently while updating my sites.

Now, the following test html validates*..

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test Font Size</title>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=iso-8859-1">
</head>
<body>
<p><font size='30pt'>Abc</font>de.</p>
</body>
</html>

* http://validator.w3.org/

Note that if I had not lazily copied the doctype
from another document, it would have read
"3.2", the flavour that a JEP will understand.

If the JEP fails for that html, my guess is that
either the html the OP is supplying is invalid,
or the JEP has a 'maximum size' set internally.

Unfortunately for the OP, I am too lazy to go
checking it further at this instant, but I would
not mind having a look over an sscce..
http://www.physci.org/codes/sscce.jsp

So ..given you (Christian) know about 10 times
as much as I ever want to know about GUI's,
I'll put the question to you.

Did I misunderstand something here, or
did you perhaps get this one wrong?

--
Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology
Christian Kaufhold - 03 Feb 2004 14:15 GMT
> "Christian Kaufhold" ...
>>
[quoted text clipped - 7 lines]
> ...
>>    size = cdata [CN]

     ^^^^^^^^^^^^^^^^^
     ^^^^^^^^^^^^^^^^^


> Now, the following test html validates*..
>
[quoted text clipped - 8 lines]
> </body>
> </html>

http://www.w3.org/TR/html4/sgml/intro.html#h-19.1

http://www.w3.org/TR/html4/types.html#type-cdata

 For some HTML 4 attributes with CDATA attribute values, the specification
 imposes further constraints on the set of legal values for the attribute
 that may not be expressed by the DTD.

Specifying that the allowed values are 1, 2, 3, 4, 5, 6, 7, +1, +2, +3, +4,
-1, -2 (for usual BASEFONT=3) is not expressible by the DTD.

Christian


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.