Oracle
  • Select Country/Region
  • Select Country/Region
  • Communities
  • I am a...
  • I want to...
  • Welcome
  • Account
  • Sign Out
  • Sign In/Register for Account
  • Help
  • Products and Services

  • Solutions

  • Downloads

  • Store

  • Support

  • Training

  • Partners

  • About

  • Oracle Technology Network

Oracle Technology Network Java JavaFX Documentation
  • Java SE
  • Java EE
  • Java ME
  • Java SE Support
  • Java SE Advanced & Suite
  • Java Embedded
  • JavaFX
  • Java DB
  • Web Tier
  • Java Card
  • Java TV
  • New to Java
  • Community
  • Java Magazine
  • Java Advanced
  • Overview
  • Downloads
  • Documentation
  • Tools
  • Community
  • Samples

FXD Specification

expand all

Profile: desktop, common

  • animation

    • KeyFrame
    • KeyValue
    • Timeline
  • animation.transition

    • AnimationPath
    • FadeTransition
    • ParallelTransition
    • PathTransition
    • PauseTransition
    • RotateTransition
    • ScaleTransition
    • SequentialTransition
    • TranslateTransition
  • fxd

    • FXDNode
  • geometry

    • BoundingBox
    • Dimension2D
    • Insets
    • Point2D
    • Point3D
    • Rectangle2D
  • scene

    • Cursor
    • Group
    • ImageCursor
    • ParallelCamera
    • PerspectiveCamera
    • Scene
  • scene.chart

    • AreaChart
    • BarChart
    • BarChart3D
    • BubbleChart
    • LineChart
    • PieChart
    • PieChart3D
    • ScatterChart
  • scene.chart.data

    • Data
    • Series
  • scene.chart.part

    • CategoryAxis
    • Legend
    • NumberAxis
  • scene.control

    • Behavior
    • Button
    • CheckBox
    • ChoiceBox
    • Hyperlink
    • IndexedCell
    • Keystroke
    • Label
    • ListCell
    • ListView
    • PasswordBox
    • ProgressBar
    • ProgressIndicator
    • RadioButton
    • ScrollBar
    • ScrollView
    • Separator
    • Slider
    • TextBox
    • ToggleButton
    • ToggleGroup
    • Tooltip
  • scene.effect

    • Blend
    • Bloom
    • BoxBlur
    • ColorAdjust
    • DisplacementMap
    • DropShadow
    • FloatMap
    • Flood
    • GaussianBlur
    • Glow
    • Identity
    • InnerShadow
    • InvertMask
    • Lighting
    • MotionBlur
    • PerspectiveTransform
    • Reflection
    • SepiaTone
    • Shadow
  • scene.effect.light

    • DistantLight
    • PointLight
    • SpotLight
  • scene.image

    • Image
    • ImageView
  • scene.layout

    • ClipView
    • Container
    • Flow
    • HBox
    • LayoutInfo
    • Panel
    • Stack
    • Tile
    • VBox
  • scene.media

    • AudioTrack
    • Media
    • MediaError
    • MediaPlayer
    • MediaTimer
    • MediaView
    • SubtitleTrack
    • VideoTrack
  • scene.paint

    • Color
    • LinearGradient
    • RadialGradient
    • Stop
  • scene.shape

    • Arc
    • ArcTo
    • Circle
    • ClosePath
    • CubicCurve
    • CubicCurveTo
    • DelegateShape
    • Ellipse
    • HLineTo
    • Line
    • LineTo
    • MoveTo
    • Path
    • Polygon
    • Polyline
    • QuadCurve
    • QuadCurveTo
    • Rectangle
    • SVGPath
    • ShapeIntersect
    • ShapeSubtract
    • VLineTo
  • scene.text

    • Font
    • Text
  • scene.transform

    • Affine
    • Rotate
    • Scale
    • Shear
    • Translate
  • Copyright 2008-2010
    Oracle Corporation
    Use is subject to license terms.

Font

Overview

The Font class represents fonts, which are used to render text on screen. Do not extend this class. It should be considered final.

Profile: common

Constants Summary

nametypedescription
DEFAULT Font

The default font for this platform. This is used whenever a font is not specifically set on a Text node.

Variable Summary

nametype Default Value description
name String

The full font name. This name includes both the family name and the style variant within that family. For example, for a plain Arial font this would be "Arial" or "Arial Regular" and for a bolded Arial font this would be "Arial Bold". The precise name to use when loading a font is defined within each font file as the full font name. For example, "Proxima Nova ExtraCondensed Bold Italic" would refer to a specific Proxima Nova font. A null or empty name allows the implementation to select any suitable font.

There is a single unified way to load both embedded and device fonts. Simply create the font by specifying the full name of the font you want to load. This class will first search for an embedded font by this name. If not found, then it will check a list of known fonts shipped with JavaFX. If the font is still not found, then system fonts will be checked. If the specific font still cannot be located, then a fallback font will be used. The "name" will be updated to reflect the actual name of the font being used. A load failure condition can be discovered by checking the name of the Font with the name you tried to load.

All other properties (such as size, letterSpacing, ligatures, etc) are used by the font to produce the correct set of glyphs and metrics for rendering text with this font, bu are not used for selecting the actual font to use.

Note that if you wish to locate a font by font family and style then you can use one of the #font script functions defined in this script.

size Number 12

The point size for this font. This may be a fractional value such as 11.5. If the specified value is < 0 the default size will be used.

embolden Boolean false

Emboldens the font algorithmically. Any font, regardless of its weight, will be made heavier if embolden is true. For example, a "regular" weighted font would become "bold", and a "bold" weighted font would become "extra bold". This variable affects the way the font is rendered, but does not affect the #name, #family, or #style.

oblique Boolean false

Obliques the font algorithmically. Any font, regardless of its posture, will be made more oblique if this variable is true. For example, a "regular" postured font will become "oblique" and an already italic or obliqued font will become even more oblique. This variable affects the way the font is rendered, but does not affect the #name, #family, or #style.

letterSpacing Number 0

Also known as tracking, letterSpacing is the amount of extra space to insert between letters or glyphs when rendering text. Increasing this value will cause the letters to be rendered further apart, while decreasing this value will cause the letters to run into each other. The default value of "0" indicates that no additional letter spacing should be used. Positive values spread the letters apart while negative values bring them closer together.

autoKern Boolean false

Indicates that automatic kerning (as described in the font) should be used. Kerning is used to adjust the distance between certain glyph sequences for a more pleasing visual result.

ligatures Boolean false

Describes whether any font ligatures should be used. A ligature is a special glyph used to represent what are normally multiple glyphs, and is typically used to make a font look better.

position FontPosition FontPosition.null

Indicates whether this font is regular, superscript, or subscript. A null value is interpreted as regular.

Function Summary

font( family: String weight: FontWeight posture: FontPosture size: Number ) : Font

Parameters
family

weight

posture

size

Profile: common

 
font( family: String weight: FontWeight size: Number ) : Font

Parameters
family

weight

size

Profile: common

 
font( family: String posture: FontPosture size: Number ) : Font

Parameters
family

posture

size

Profile: common

 
font( family: String size: Number ) : Font

Searches for an appropriate font based on the font family name and size. This method is not guaranteed to return a specific font, but does its best to find one that fits the specified requirements. A null or empty value for family allows the implementation to select any suitable font.

Searches for an appropriate font based on the font family name and size. This method is not guaranteed to return a specific font, but does its best to find one that fits the specified requirements. A null or empty value for family allows the implementation to select any suitable font.

Parameters
family

size

Profile: common

 
fontFromURL( url: String size: Number ) : Font

Parameters
url

size

Profile: common

 
    E-mail this page    Printer View Printer View
 
    Oracle Cloud
  • Learn About Oracle Cloud
  • Get a Free Trial
  • Learn About PaaS
  • Learn About SaaS
  • Learn About IaaS
    Java
  • Learn About Java
  • Download Java for Consumers
  • Download Java for Developers
  • Java Resources for Developers
  • Java Cloud Service
  • Java Magazine
    Customer and Events
  • Explore and Read Customer Stories
  • All Oracle Events
  • Oracle OpenWorld
  • JavaOne
    Communities
  • Blogs
  • Discussion Forums
  • Wikis
  • Oracle ACEs
  • User Groups
  • Social Media Channels
    Services and Store
  • Log In to My Oracle Support
  • Training and Certification
  • Become a Partner
  • Find a Partner Solution
  • Purchase from the Oracle Store
  • Contact and Chat
    Global Contacts
    Oracle Support
    Phone: 800-633-0738
 

Hardware and Software, Engineered to Work Together

  • Subscribe
  • Careers
  • Contact Us
  • Site Maps
  • Legal Notices
  • Terms of Use
  • Privacy
  •  
  • Facebook
  • LinkedIn
  • Twitter
  • Google+
  • YouTube
  • Oracle RSS Feed