mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-05 03:50:07 +00:00
Font: Update return type of getOutlineForGlyph
This commit is contained in:
parent
0d2e34f34c
commit
ec2d221b08
3 changed files with 22 additions and 5 deletions
|
|
@ -2,6 +2,24 @@
|
|||
|
||||
# Version 8.0.0
|
||||
|
||||
## Change
|
||||
|
||||
Typeface::getOutlineForGlyph now returns void instead of bool.
|
||||
|
||||
**Possible Issues**
|
||||
|
||||
Code that checks the result of this function will fail to compile.
|
||||
|
||||
**Workaround**
|
||||
|
||||
Omit any checks against the result of this function.
|
||||
|
||||
**Rationale**
|
||||
|
||||
This function can no longer fail. It may still output an empty path if the
|
||||
requested glyph isn't present in the typeface.
|
||||
|
||||
|
||||
## Change
|
||||
|
||||
CustomTypeface has been removed.
|
||||
|
|
|
|||
|
|
@ -261,15 +261,13 @@ static Path getTypefaceGlyph (const Typeface& typeface, int glyphNumber)
|
|||
return result;
|
||||
}
|
||||
|
||||
bool Typeface::getOutlineForGlyph (int glyphNumber, Path& path)
|
||||
void Typeface::getOutlineForGlyph (int glyphNumber, Path& path)
|
||||
{
|
||||
const auto metrics = getNativeDetails().getLegacyMetrics();
|
||||
|
||||
// getTypefaceGlyph returns glyphs in em space, getOutlineForGlyph returns glyphs in "special JUCE units" space
|
||||
path = getTypefaceGlyph (*this, glyphNumber);
|
||||
path.applyTransform (AffineTransform::scale (metrics.getHeightToPointsFactor()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Typeface::applyVerticalHintingTransform (float, Path&)
|
||||
|
|
@ -280,8 +278,9 @@ void Typeface::applyVerticalHintingTransform (float, Path&)
|
|||
EdgeTable* Typeface::getEdgeTableForGlyph (int glyphNumber, const AffineTransform& transform, float)
|
||||
{
|
||||
Path path;
|
||||
getOutlineForGlyph (glyphNumber, path);
|
||||
|
||||
if (! getOutlineForGlyph (glyphNumber, path) || path.isEmpty())
|
||||
if (path.isEmpty())
|
||||
return nullptr;
|
||||
|
||||
return new EdgeTable (path.getBoundsTransformed (transform).getSmallestIntegerContainer().expanded (1, 0),
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ public:
|
|||
/** Returns the outline for a glyph.
|
||||
The path returned will be normalised to a font height of 1.0.
|
||||
*/
|
||||
bool getOutlineForGlyph (int glyphNumber, Path& path);
|
||||
void getOutlineForGlyph (int glyphNumber, Path& path);
|
||||
|
||||
/** Returns a new EdgeTable that contains the path for the given glyph, with the specified transform applied. */
|
||||
EdgeTable* getEdgeTableForGlyph (int glyphNumber, const AffineTransform& transform, float fontHeight);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue