NVPR Shaped Text Sample


Category:  Visuals
Min PC GPU: Fermi-based (GTX 4xx)
Min Tegra Device: Tegra K1

Description

This sample demonstrates sophisticated text layout using the open source HarfBuzz text shaping engine library to position glyphs for strings of Unicode text.

APIs Used

Shared User Interface

The OpenGL samples all share a common app framework and certain user interface elements, centered around the "Tweakbar" panel on the left side of the screen, which lets you interactively control certain variables in each sample.

To show and hide the Tweakbar, simply click or touch the triangular button positioned in the top-left of the view.

Other controls are listed below.

Device Input Result
touch 2-Finger Drag Translate the view
2-Finger Pinch Scale the view
mouse Left-Click Drag Translate the view
Right-Click Drag Scale the view (up:out, down:in)
keyboard Escape Quit the application
  Tab Toggle Tweakbar visibility
gamepad Start Toggle Tweakbar visibility

App-Specific Controls

This sample has the following app-specific controls:

keyboard R Reset Scene
F Toggle Path Fill
S Toggle Path Stroke
, / . Font Size -/+
gamepad X Reset Scene
Left Shoulder Button Toggle Path Fill
Right Shoulder Button Toggle Path Stroke
DPAD Left/Right Font Size -/+

Technical Details

Samples of text in various languages using appropriate scripts are rendered from their resolution-independent outlines. NV_path_rendering does the work of rendering font glyphs of TrueType/OpenType, with HarfBuzz doing glyph positioning and Unicode script shaping, and FreeType2 used to load the underlying metrics for each font.

The sample relies on revision 1.3 of the NV_path_rendering extension that adds support for glyph indexed font usage. In particular, glPathGlyphIndexArrayNVand glPathMemoryGlyphIndexArrayNV.

See Also

 

 


NVIDIA® GameWorks™ Documentation Rev. 1.0.200601 ©2014-2020. NVIDIA Corporation. All Rights Reserved.