JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.graph.font.FontScale Class Reference

Simple static font scale methods for unit conversions. More...

Collaboration diagram for com.jogamp.graph.font.FontScale:

Static Public Member Functions

static float ptToInch (final float points)
 Converts the the given points size to inch, dividing by 72 points per inch. More...
 
static float ptToMM (final float points)
 Converts the the given points size to mm, dividing by 72 * 25.4 points per inch. More...
 
static float toPixels (final float points, final float res_dpi)
 Converts typical font size in points and screen resolution in dpi (pixels-per-inch) to font size in pixels, which can be used for pixel-size font scaling operations. More...
 
static float toPixels2 (final float points, final float res_ppmm)
 Converts typical font size in points and screen resolution in pixels (pixels-per-mm) to font size in pixels, which can be used for pixel-size font scaling operations. More...
 
static float[] ppmmToPPI (final float[] ppmm)
 Converts [1/mm] to [1/inch] in place. More...
 
static float[] ppmmToPPI (final float[] ppmm, final float[] res)
 Converts [1/mm] to [1/inch] into res storage. More...
 
static float[] ppiToPPMM (final float[] ppi)
 Converts [1/inch] to [1/mm] in place. More...
 
static float[] ppiToPPMM (final float[] ppi, final float[] res)
 Converts [1/inch] to [1/mm] into res storage. More...
 

Detailed Description

Simple static font scale methods for unit conversions.

PostScript - current DTP point system used e.g in CSS (Cascading Style Sheets).

  • 1 point = 1pt = 1/72in (cala) = 0.3528 mm
  • 1 pica = 1pc = 12pt= 1/6in (cala) = 4.233(3) mm

Definition at line 37 of file FontScale.java.

Member Function Documentation

◆ ppiToPPMM() [1/2]

static float[] com.jogamp.graph.font.FontScale.ppiToPPMM ( final float[]  ppi)
static

Converts [1/inch] to [1/mm] in place.

Parameters
ppifloat[2] [1/inch] value
Returns
return [1/mm] value

Definition at line 128 of file FontScale.java.

Here is the caller graph for this function:

◆ ppiToPPMM() [2/2]

static float[] com.jogamp.graph.font.FontScale.ppiToPPMM ( final float[]  ppi,
final float[]  res 
)
static

Converts [1/inch] to [1/mm] into res storage.

Parameters
ppifloat[2] [1/inch] value
resthe float[2] result storage
Returns
return [1/mm] value, i.e. the given res storage

Definition at line 140 of file FontScale.java.

◆ ppmmToPPI() [1/2]

static float[] com.jogamp.graph.font.FontScale.ppmmToPPI ( final float[]  ppmm)
static

Converts [1/mm] to [1/inch] in place.

Parameters
ppmmfloat[2] [1/mm] value
Returns
return [1/inch] value

Definition at line 105 of file FontScale.java.

Here is the caller graph for this function:

◆ ppmmToPPI() [2/2]

static float[] com.jogamp.graph.font.FontScale.ppmmToPPI ( final float[]  ppmm,
final float[]  res 
)
static

Converts [1/mm] to [1/inch] into res storage.

Parameters
ppmmfloat[2] [1/mm] value
resthe float[2] result storage
Returns
return [1/inch] value, i.e. the given res storage

Definition at line 117 of file FontScale.java.

◆ ptToInch()

static float com.jogamp.graph.font.FontScale.ptToInch ( final float  points)
static

Converts the the given points size to inch, dividing by 72 points per inch.

  1 points = 1/72 inch

Definition at line 45 of file FontScale.java.

Here is the caller graph for this function:

◆ ptToMM()

static float com.jogamp.graph.font.FontScale.ptToMM ( final float  points)
static

Converts the the given points size to mm, dividing by 72 * 25.4 points per inch.

  1 inch = 25.4 mm
  1 points = 1/72 inch
  1 points = 1/72 * 25.4 mm

Definition at line 58 of file FontScale.java.

Here is the caller graph for this function:

◆ toPixels()

static float com.jogamp.graph.font.FontScale.toPixels ( final float  points,
final float  res_dpi 
)
static

Converts typical font size in points and screen resolution in dpi (pixels-per-inch) to font size in pixels, which can be used for pixel-size font scaling operations.

 Font Scale Formula:
  1 points = 1/72 inch

  pixels = points / 72 * res_dpi
Parameters
pointsin points
res_dpidisplay resolution in pixels-per-inch
Returns
pixelSize scale factor for font operations.
See also
toPixels2(float, float)

Definition at line 76 of file FontScale.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toPixels2()

static float com.jogamp.graph.font.FontScale.toPixels2 ( final float  points,
final float  res_ppmm 
)
static

Converts typical font size in points and screen resolution in pixels (pixels-per-mm) to font size in pixels, which can be used for pixel-size font scaling operations.

 Font Scale Formula:
  1 inch = 25.4 mm
  1 points = 1/72 inch
  1 points = 1/72 * 25.4 mm

  pixels = points / 72 * 25.4 * res_ppmm
Parameters
pointsin points
res_ppmmdisplay resolution in pixels-per-mm
Returns
pixelSize scale factor for font operations.
See also
toPixels(float, float)

Definition at line 96 of file FontScale.java.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: