JavaFX (8) Modena: Default font size for labels - javafx

What is the default font size for labels in JavaFX' Modena design?
I know there is this CSS in the JAR but is there an easy way to determine such values?

Reading CSS is the best option to know defaults for one particular release. To get this CSS you can unzip the jar file:
JDK7,8:
"$JAVA_HOME/bin/jar" xvf "$JAVA_HOME/jre/lib/ext/jfxrt.jar" com/sun/javafx/scene/control/skin/modena/modena.css
JDK9
"$JAVA_HOME/bin/jmod" extract "$JAVA_HOME/jmods/javafx.controls.jmod"
cat classes/com/sun/javafx/scene/control/skin/modena/modena.css
You can find documentation for JavaFX CSS here: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html

try override the label css, this will multiply all labels size by 1.1
.label {
-fx-font-size:1.1em
}

Take a look in modena.css: https://gist.github.com/maxd/63691840fc372f22f470 (lines 48-55).
From line 54-55:
The default sizes are based on Windows default of 12px, as a quick
reference here are common px sizes in em units on windows.

Related

Why does the base font size change when moving from development to production build in reactjs

I use rem as unit for specifying font sizes and for other dimensions. I've also set :root {font-size: 16px} in the stylesheet and everything seems fine but when the build is made, The overall size is reduced.
⇥ Does the build process automatically change the base font size anyhow
⇥ If not, why does this problem occur
Note: Browser window is not zoomed in
It is hard to tell without more information.
Tell something about difference like browser you used, what kind of unit do you use? Pixels or rems? etc.
Now, I would check what styles are in body element.
Build shouldn't change anything, but it depends on details.
Do you use external styles and what kind of symbols with versioning do you use (see this for more info: https://bytearcher.com/articles/semver-explained-why-theres-a-caret-in-my-package-json/). If you use external styles and locally npm install other package then in build it could do the differece.
If no of these hints helped, please tell more about the details of your situation.

How to control the default fontsize when creating ttf file using fontforge?

I am deploying fontforge (python script )to create ttf file. I found the fontsize is a little small when using it in android phone. But I don't know how to tune the default fontsize when creating ttf.
So my question is How to control the default fontsize when creating ttf file using fontforge? Any suggestion will appreciated.
The apparent size of a font is determined by the font metrics and the size of the glyphs you draw. Here are my instructions for how to achieve sensible sizing: http://benwhitmore.altervista.org/line-spacing-getting-right/

How can I manage css and php gd2 font size?

Font size of php gd2 and css is different.
How can I manage it?
Any formula to manage it?
Because when I send a string with font size in css it prints much larger in php gd2 than css font.
Please tell me some ideas to manage it.
in different versions of php_GD there different types of fonts. if you are using php-gd2 font type is used pt (point) not px. and in first php-gd i think px is font unit.

How to set colors to a specific contrast ratio?

I am working on a project and I have a request to set the footer to a 4:5 contrast ratio. I've never had to alter this, so after searching I found this neat tool that lets you fiddle with the colors and see a contrast ratio you get. http://leaverou.github.io/contrast-ratio/#
I was wondering if theres another way to do this? The only set of instructions I recieved was to set the font of the footer to 12pt, and a 4:5 contrast ratio (the footer background is black).
Thanks!
Use SASS to accomplish this. Simply install ruby and then run:
gem install SASS
sass --watch /path/to/sass path/to/css
This will watch and convert any SASS files in the first directory to CSS in the second directory. You can then use functions in the SASS to handle lightening and darkening of colors with variables. A quick example:
#black: #000;
footer {
background-color: lighten(#black, 20%);
}
and it will render completely valid CSS using ruby to handle the variables and lightening of the background by 20%

Can I set font-size accordingly to font availability?

Is it possible to set a different font-size according to font availability?
Currently my problem is that Verdana is too big, and if the user don't have Verdana installed, I will end up with a very small font-size
Is there is any way to set a font (Verdana in my case) to 13px and if the user don't have that font installed, try with another font (Arial for example) but with bigger font-size?
Notes:
Preferably CSS only
CSS hacks allowed
As was answered just a minute ago by someone else (but already deleted?), you could use Font Detector Javascript solution:
http://jsfiddle.net/FHnJw/1
This might take some work to implement (I have not ever actually done it myself), but it seems that the font-size-adjust property helps "equalize" font's by standardizing the x-height. See http://www.w3.org/TR/css3-fonts/#propdef-font-size-adjust for the official description.
Font-size adjust only works with Firefox
The standalone 'font' css declaration only allows you to state font-size, style and weight once before declaring the different font families in succession so that's a no-go either
I'm sorry to say this cannot be done through css alone
As for the JS alternative, here's the one I recommend:
http://www.lalit.org/lab/javascript-css-font-detect/
Good luck

Resources