Skip to content

Commit 0005f65

Browse files
author
Andy Goryachev
committed
8299756: Minor updates in CSS Reference
Reviewed-by: kcr, jhendrikx, mhanl
1 parent 7825137 commit 0005f65

File tree

2 files changed

+91
-6
lines changed

2 files changed

+91
-6
lines changed

modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!--
44
/*
5-
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
5+
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
66
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
77
*
88
* This code is free software; you can redistribute it and/or modify it
@@ -277,6 +277,7 @@ <h2>Contents</h2>
277277
<li><a href="#typefont">&lt;font&gt;</a></li>
278278
<li><a href="#typepaint">&lt;paint&gt;</a></li>
279279
<li><a href="#typecolor">&lt;color&gt;</a></li>
280+
<li><a href="#typetextbounds">&lt;text-bounds&gt;</a></li>
280281
</ul>
281282
</li>
282283
<li><a href="#stage">Stage</a>
@@ -351,6 +352,7 @@ <h2>Contents</h2>
351352
<li>javafx.scene.text
352353
<ul>
353354
<li><a href="#text">Text</a></li>
355+
<li><a href="#textflow">TextFlow</a></li>
354356
</ul>
355357
</li>
356358
</ul>
@@ -1071,6 +1073,7 @@ <h3><a id="typefont">&lt;font&gt;</a></h3>
10711073
font family. An actual font family name available on the system can be
10721074
used, or one of the following generic family names can be used:</p>
10731075
<ul>
1076+
<li>'system'</li>
10741077
<li>'serif' (e.g., Times)</li>
10751078
<li>'sans-serif' (e.g., Helvetica)</li>
10761079
<li>'cursive' (e.g., Zapf-Chancery)</li>
@@ -1576,6 +1579,32 @@ <h4>Color Functions <span class="grammar" style="font-size: smaller;">&lt;color-
15761579
href="#typecolor"
15771580
class="typelink">&lt;color&gt;</a>
15781581
) ]+ </span></p>
1582+
<h3><a id="typetextbounds">&lt;text-bounds&gt;</a></h3>
1583+
<p>The geometry of text can be measured either in terms of the bounds of
1584+
the particular text to be rendered - visual bounds, or as properties
1585+
of the font and the characters to be rendered - logical bounds.
1586+
Visual bounds are more useful for positioning text as graphics, and
1587+
for obtaining tight enclosing bounds around the text.</p>
1588+
<p>Logical bounds are important for laying out text relative to other
1589+
text and other components, particularly those which also contain text.
1590+
The bounds aren't specific to the text being rendered, and so will
1591+
report heights which account for the potential ascent and descent of
1592+
text using the font at its specified size. Also leading and trailing
1593+
spaces are part of the logical advance width of the text.</p>
1594+
<p>&nbsp;</p>
1595+
<p class="grammar">[ logical | visual | logical-vertical-center ]</p>
1596+
<ul>
1597+
<li><strong>logical</strong>: The logical bounds are based on font metrics information.
1598+
The width is based on the glyph advances and the height of the ascent, descent, and
1599+
line gap, except for the last line which does not include the line gap.
1600+
This is usually the fastest option.</li>
1601+
<li><strong>visual</strong>: Use visual bounds as the basis for calculating the bounds.
1602+
This is likely to be slower than using logical bounds.</li>
1603+
<li><strong>logical-vertical-center</strong>: Use logical vertical centered bounds
1604+
as the basis for calculating the bounds.
1605+
This bounds type is typically used to center Text nodes vertically
1606+
within the bounds of its parent.</li>
1607+
</ul>
15791608
<h2><a id="stage">Stage</a></h2>
15801609
<table class="package" width="100%">
15811610
<tbody>
@@ -1668,7 +1697,7 @@ <h4><a id="node">Node</a></h4>
16681697
<td class="default">false</td>
16691698
<td class="range">&nbsp;</td>
16701699
<td>The default value for controls is true, although there are some exceptions.
1671-
See <a href="#controls">Controls</a> for details.</td>
1700+
See <a href="#control">Control</a> for details.</td>
16721701
</tr>
16731702
<tr>
16741703
<th class="propertyname" scope="row">-fx-view-order</th>
@@ -3024,6 +3053,24 @@ <h4><a id="text">Text</a></h4>
30243053
</tr>
30253054
</thead>
30263055
<tbody>
3056+
<tr>
3057+
<th class="propertyname" scope="row">-fx-bounds-type</th>
3058+
<td class="value"><a href="#typetextbounds" class="typelink">&lt;text-bounds&gt;</a></td>
3059+
<td>logical</td>
3060+
<td></td>
3061+
</tr>
3062+
<tr>
3063+
<th class="propertyname" scope="row">-fx-line-spacing</th>
3064+
<td class="value"><a href="#typenumber" class="typelink">&lt;number&gt;</a></td>
3065+
<td>0</td>
3066+
<td>&nbsp;</td>
3067+
</tr>
3068+
<tr>
3069+
<th class="propertyname" scope="row">-fx-fill</th>
3070+
<td class="value"><a href="#typepaint" class="typelink">&lt;paint&gt;</a></td>
3071+
<td>BLACK</td>
3072+
<td>text color</td>
3073+
</tr>
30273074
<tr>
30283075
<th class="propertyname" scope="row">-fx-font</th>
30293076
<td class="value"><a href="#typefont" class="typelink">&lt;font&gt;</a></td>
@@ -3072,6 +3119,43 @@ <h4><a id="text">Text</a></h4>
30723119
</tr>
30733120
</tbody>
30743121
</table>
3122+
<h4><a id="textflow">TextFlow</a></h4>
3123+
<p class="styleclass">Style class: empty by default</p>
3124+
<table class="csspropertytable">
3125+
<caption>Available CSS Properties</caption>
3126+
<thead>
3127+
<tr>
3128+
<th class="propertyname" scope="col">CSS Property</th>
3129+
<th class="value" scope="col">Values</th>
3130+
<th scope="col">Default</th>
3131+
<th scope="col">Comments</th>
3132+
</tr>
3133+
</thead>
3134+
<tbody>
3135+
<tr>
3136+
<th class="propertyname" scope="row">-fx-line-spacing</th>
3137+
<td class="value"><a href="#typenumber" class="typelink">&lt;number&gt;</a></td>
3138+
<td>0</td>
3139+
<td>&nbsp;</td>
3140+
</tr>
3141+
<tr>
3142+
<th class="propertyname" scope="row">-fx-tab-size</th>
3143+
<td class="value"><a href="#typenumber" class="typelink">&lt;integer&gt;</a></td>
3144+
<td>8</td>
3145+
<td>&nbsp;</td>
3146+
</tr>
3147+
<tr>
3148+
<th class="propertyname" scope="row">-fx-text-alignment</th>
3149+
<td class="value">[ left | center | right | justify ] </td>
3150+
<td>left</td>
3151+
<td>inherits</td>
3152+
</tr>
3153+
<tr>
3154+
<th colspan="4" class="parents" scope="row">Also has <a href="#fontprops">font
3155+
properties</a> and all properties of <a href="#pane">Pane</a></th>
3156+
</tr>
3157+
</tbody>
3158+
</table>
30753159
<table class="package" width="100%">
30763160
<tbody>
30773161
<tr>
@@ -3158,6 +3242,7 @@ <h4><a id="webview">WebView</a></h4>
31583242
</tbody>
31593243
</table>
31603244
<!-- Controls -->
3245+
<h2><a id="controls">Controls</a></h2>
31613246
<table class="package" width="100%">
31623247
<tbody>
31633248
<tr>

modules/javafx.graphics/src/main/java/javafx/scene/text/TextBoundsType.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
3838
* <p>
3939
* Logical bounds are important for laying out text relative to other
4040
* text and other components, particularly those which also contain text.
41-
* The bounds isn't specific to the text being rendered, and so will
41+
* The bounds aren't specific to the text being rendered, and so will
4242
* report heights which account for the potential ascent and descent of
4343
* text using the font at its specified size. Also leading and trailing
4444
* spaces are part of the logical advance width of the text.
@@ -51,8 +51,8 @@ public enum TextBoundsType {
5151
* Use logical bounds as the basis for calculating the bounds.
5252
* <p>
5353
* The logical bounds are based on font metrics information. The width is
54-
* based on the glyph advances and the height on the ascent, descent, and
55-
* line gap. Except for the last line which does not include the line gap.
54+
* based on the glyph advances and the height of the ascent, descent, and
55+
* line gap, except for the last line which does not include the line gap.
5656
* <p>
5757
* Note: This is usually the fastest option.
5858
*/

0 commit comments

Comments
 (0)