openshot-audio  0.1.6
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
juce::Typeface Class Referenceabstract

#include <juce_graphics.h>

Inheritance diagram for juce::Typeface:
juce::ReferenceCountedObject juce::CustomTypeface

Classes

struct  HintingParams
 

Public Types

typedef
ReferenceCountedObjectPtr
< Typeface
Ptr
 

Public Member Functions

const StringgetName () const noexcept
 
const StringgetStyle () const noexcept
 
virtual ~Typeface ()
 
virtual bool isSuitableForFont (const Font &) const
 
virtual float getAscent () const =0
 
virtual float getDescent () const =0
 
virtual float getHeightToPointsFactor () const =0
 
virtual float getStringWidth (const String &text)=0
 
virtual void getGlyphPositions (const String &text, Array< int > &glyphs, Array< float > &xOffsets)=0
 
virtual bool getOutlineForGlyph (int glyphNumber, Path &path)=0
 
virtual EdgeTablegetEdgeTableForGlyph (int glyphNumber, const AffineTransform &transform, float fontHeight)
 
virtual bool isHinted () const
 
void applyVerticalHintingTransform (float fontHeight, Path &path)
 
- Public Member Functions inherited from juce::ReferenceCountedObject
void incReferenceCount () noexcept
 
void decReferenceCount () noexcept
 
bool decReferenceCountWithoutDeleting () noexcept
 
int getReferenceCount () const noexcept
 

Static Public Member Functions

static Ptr createSystemTypefaceFor (const Font &font)
 
static Ptr createSystemTypefaceFor (const void *fontFileData, size_t fontFileDataSize)
 
static void setTypefaceCacheSize (int numFontsToCache)
 
static void clearTypefaceCache ()
 
static void scanFolderForFonts (const File &folder)
 

Protected Member Functions

 Typeface (const String &name, const String &style) noexcept
 
- Protected Member Functions inherited from juce::ReferenceCountedObject
 ReferenceCountedObject ()
 
virtual ~ReferenceCountedObject ()
 
void resetReferenceCount () noexcept
 

Static Protected Member Functions

static Ptr getFallbackTypeface ()
 

Protected Attributes

String name
 
String style
 

Friends

struct ContainerDeletePolicy< HintingParams >
 

Detailed Description

A typeface represents a size-independent font.

This base class is abstract, but calling createSystemTypefaceFor() will return a platform-specific subclass that can be used.

The CustomTypeface subclass allow you to build your own typeface, and to load and save it in the Juce typeface format.

Normally you should never need to deal directly with Typeface objects - the Font class does everything you typically need for rendering text.

See also
CustomTypeface, Font

Member Typedef Documentation

A handy typedef for a pointer to a typeface.

Constructor & Destructor Documentation

Typeface::~Typeface ( )
virtual

Destructor.

Typeface::Typeface ( const String name,
const String style 
)
protectednoexcept

Member Function Documentation

void Typeface::applyVerticalHintingTransform ( float  fontHeight,
Path path 
)

Makes an attempt at performing a good overall distortion that will scale a font of the given size to align vertically with the pixel grid. The path should be an unscaled (i.e. normalised to height of 1.0) path for a glyph.

void Typeface::clearTypefaceCache ( )
static

Clears any fonts that are currently cached in memory.

static Ptr juce::Typeface::createSystemTypefaceFor ( const Font font)
static

Creates a new system typeface.

static Ptr juce::Typeface::createSystemTypefaceFor ( const void *  fontFileData,
size_t  fontFileDataSize 
)
static

Attempts to create a font from some raw font file data (e.g. a TTF or OTF file image). The system will take its own internal copy of the data, so you can free the block once this method has returned.

virtual float juce::Typeface::getAscent ( ) const
pure virtual

Returns the ascent of the font, as a proportion of its height. The height is considered to always be normalised as 1.0, so this will be a value less that 1.0, indicating the proportion of the font that lies above its baseline.

Implemented in juce::CustomTypeface.

virtual float juce::Typeface::getDescent ( ) const
pure virtual

Returns the descent of the font, as a proportion of its height. The height is considered to always be normalised as 1.0, so this will be a value less that 1.0, indicating the proportion of the font that lies below its baseline.

Implemented in juce::CustomTypeface.

EdgeTable * Typeface::getEdgeTableForGlyph ( int  glyphNumber,
const AffineTransform transform,
float  fontHeight 
)
virtual

Returns a new EdgeTable that contains the path for the givem glyph, with the specified transform applied.

Reimplemented in juce::CustomTypeface.

Typeface::Ptr Typeface::getFallbackTypeface ( )
staticprotected
virtual void juce::Typeface::getGlyphPositions ( const String text,
Array< int > &  glyphs,
Array< float > &  xOffsets 
)
pure virtual

Converts a line of text into its glyph numbers and their positions. The distances returned are based on the font having an normalised height of 1.0. You should never need to call this directly! Use Font::getGlyphPositions() instead!

Implemented in juce::CustomTypeface.

virtual float juce::Typeface::getHeightToPointsFactor ( ) const
pure virtual

Returns the value by which you should multiply a juce font-height value to convert it to the equivalent point-size.

Implemented in juce::CustomTypeface.

const String& juce::Typeface::getName ( ) const
inlinenoexcept

Returns the font family of the typeface.

See also
Font::getTypefaceName
virtual bool juce::Typeface::getOutlineForGlyph ( int  glyphNumber,
Path path 
)
pure virtual

Returns the outline for a glyph. The path returned will be normalised to a font height of 1.0.

Implemented in juce::CustomTypeface.

virtual float juce::Typeface::getStringWidth ( const String text)
pure virtual

Measures the width of a line of text. The distance returned is based on the font having an normalised height of 1.0. You should never need to call this directly! Use Font::getStringWidth() instead!

Implemented in juce::CustomTypeface.

const String& juce::Typeface::getStyle ( ) const
inlinenoexcept

Returns the font style of the typeface.

See also
Font::getTypefaceStyle
virtual bool juce::Typeface::isHinted ( ) const
inlinevirtual

Returns true if the typeface uses hinting.

virtual bool juce::Typeface::isSuitableForFont ( const Font ) const
inlinevirtual

Returns true if this typeface can be used to render the specified font. When called, the font will already have been checked to make sure that its name and style flags match the typeface.

static void juce::Typeface::scanFolderForFonts ( const File folder)
static

On some platforms, this allows a specific path to be scanned. Currently only available when using FreeType.

static void juce::Typeface::setTypefaceCacheSize ( int  numFontsToCache)
static

Changes the number of fonts that are cached in memory.

Friends And Related Function Documentation

friend struct ContainerDeletePolicy< HintingParams >
friend

Member Data Documentation

String juce::Typeface::name
protected
String juce::Typeface::style
protected

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