Browse Source

Text: doc++

Forgot to actually proofread the thing, apparently, not putting mentions
of the new class where they should be.
pull/674/head
Vladimír Vondruš 1 year ago
parent
commit
37902520e3
  1. 7
      src/Magnum/Text/DistanceFieldGlyphCacheGL.h
  2. 14
      src/Magnum/Text/Renderer.h

7
src/Magnum/Text/DistanceFieldGlyphCacheGL.h

@ -45,8 +45,10 @@ namespace Magnum { namespace Text {
Extends @ref GlyphCacheGL by processing rendered glyphs to a signed distance Extends @ref GlyphCacheGL by processing rendered glyphs to a signed distance
field texture using @ref TextureTools::DistanceFieldGL, allowing them to be field texture using @ref TextureTools::DistanceFieldGL, allowing them to be
drawn at different sizes and with various transformations without aliasing drawn at different sizes and with various transformations without aliasing
artifacts. It's possible to only use this cache for monochrome glyphs as the artifacts. @ref DistanceFieldGlyphCacheArrayGL is then using a
internal texture format is single-channel. @ref GL::Texture2DArray instead of a @ref GL::Texture2D. It's possible to only
use this cache for monochrome glyphs as the internal texture format is
single-channel.
@section Text-DistanceFieldGlyphCacheGL-usage Usage @section Text-DistanceFieldGlyphCacheGL-usage Usage
@ -232,7 +234,6 @@ class MAGNUM_TEXT_EXPORT DistanceFieldGlyphCacheArrayGL: public GlyphCacheArrayG
/** /**
* @brief Construct without creating the internal state and the OpenGL texture object * @brief Construct without creating the internal state and the OpenGL texture object
* @m_since_latest
* *
* The constructed instance is equivalent to moved-from state, i.e. no * The constructed instance is equivalent to moved-from state, i.e. no
* APIs can be safely called on the object. Useful in cases where you * APIs can be safely called on the object. Useful in cases where you

14
src/Magnum/Text/Renderer.h

@ -780,8 +780,9 @@ glyph quads don't cut into each other. Assuming the drawing is performed in a
below sets up the drawing that the font pixel size matches the window pixels by below sets up the drawing that the font pixel size matches the window pixels by
specifying @ref Platform::Sdl2Application::windowSize() "Platform::*Application::windowSize()" specifying @ref Platform::Sdl2Application::windowSize() "Platform::*Application::windowSize()"
as the projection size, and it appears in the center of the window. With as the projection size, and it appears in the center of the window. With
@ref GlyphCacheArrayGL or @ref DistanceFieldGlyphCacheGL the drawing setup is @ref GlyphCacheArrayGL, @ref DistanceFieldGlyphCacheGL or
slightly different, see their documentation for examples. @ref DistanceFieldGlyphCacheArrayGL the drawing setup is slightly different,
see their documentation for examples.
@snippet Text-gl.cpp Renderer-usage-draw @snippet Text-gl.cpp Renderer-usage-draw
@ -934,10 +935,11 @@ The second approach, with text size being relative to the window size, is for
cases where the text is meant to match surrounding art, such as in a game menu. cases where the text is meant to match surrounding art, such as in a game menu.
In this case the projection size is usually something arbitrary that doesn't In this case the projection size is usually something arbitrary that doesn't
match window pixels, and the text point size then has to be relative to that. match window pixels, and the text point size then has to be relative to that.
For this use case a @ref DistanceFieldGlyphCacheGL is the better match, as it For this use case a @ref DistanceFieldGlyphCacheGL /
can provide text at different sizes without the scaling causing blurriness or @ref DistanceFieldGlyphCacheArrayGL is the better match, as it can provide text
aliased edges. See its documentation for details about picking the right font at different sizes without the scaling causing blurriness or aliased edges. See
size and other parameters for best results. its documentation for details about picking the right font size and other
parameters for best results.
@subsection Text-Renderer-usage-font-size-dpi DPI awareness @subsection Text-Renderer-usage-font-size-dpi DPI awareness

Loading…
Cancel
Save