CSS Font size in points doesn't match Node.Font.Size

Tom Schindl tom.schindl at bestsolution.at
Wed Mar 5 15:18:57 PST 2014


The question the is why fairly all other toolkits use point in their APIs.

Some examples:
* Qt: http://qt-project.org/doc/qt-5/qfont.html#QFont-2
* Cocoa:
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSFont_Class/Reference/Reference.html#//apple_ref/occ/clm/NSFont/fontWithName:size:
* Pango:
https://developer.gnome.org/pango/stable/pango-Fonts.html#pango-font-description-set-size
* AWT:
http://docs.oracle.com/javase/7/docs/api/java/awt/Font.html#Font%28java.lang.String,%20int,%20int%29
* SWT:
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fswt%2Fgraphics%2FFont.html

Why can't JavaFX not at least provide a font-API to create fonts with point?

Tom


On 05.03.14 23:59, David Grieve wrote:
> Everyone should just accept that there is no such thing as a 'point' in
> JavaFX. Work in pixels and you will achieve nirvana.
> 
> On 3/5/14, 5:49 PM, Pedro Duque Vieira wrote:
>> Here is the definition of point:
>> http://www.w3schools.com/cssref/css_units.asp
>>
>> As Jeff is saying it should be 1/72 inch.
>>
>> I think this should be the default. Isn't the introduction of modena
>> potentially going to break more apps than changing the definition of
>> point?
>> Aren't breaking apps making use of a bug that they shouldn't be taking
>> advantage of in the first place?
>>
>> That being said, and if changing the default point definition is not
>> really
>> possible, being able to change this through a global settings property so
>> that node matches CSS, sound like a reasonable workaround.
>>
>> Thanks!
>>
>>
> 



More information about the openjfx-dev mailing list