1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-25 02:04:23 +00:00

Changed Font::findFonts() to use an Array instead of an OwnedArray.

This commit is contained in:
Julian Storer 2010-02-12 18:07:28 +00:00
parent fb7cf838db
commit 7d9b068a49
6 changed files with 19 additions and 8 deletions

View file

@ -33,11 +33,11 @@ class FontList : public DeletedAtShutdown
public:
FontList()
{
OwnedArray<Font> fonts;
Array<Font> fonts;
Font::findFonts (fonts);
for (int i = 0; i < fonts.size(); ++i)
fontNames.add (fonts[i]->getTypefaceName());
fontNames.add (fonts[i].getTypefaceName());
}
~FontList()

View file

@ -85823,12 +85823,12 @@ void Font::getGlyphPositions (const String& text, Array <int>& glyphs, Array <fl
}
}
void Font::findFonts (OwnedArray<Font>& destArray) throw()
void Font::findFonts (Array<Font>& destArray) throw()
{
const StringArray names (findAllTypefaceNames());
for (int i = 0; i < names.size(); ++i)
destArray.add (new Font (names[i], defaultFontHeight, Font::plain));
destArray.add (Font (names[i], defaultFontHeight, Font::plain));
}
class TypefaceCache : public DeletedAtShutdown

View file

@ -4947,6 +4947,11 @@ public:
return position >= start && position < end;
}
ValueType clipValue (const ValueType value) const throw()
{
return jlimit (start, end, value);
}
bool intersects (const Range& other) const throw()
{
return other.start < end && other.end > start;
@ -10689,7 +10694,7 @@ public:
Typeface* getTypeface() const throw();
static void findFonts (OwnedArray<Font>& results) throw();
static void findFonts (Array<Font>& results) throw();
static const StringArray findAllTypefaceNames() throw();

View file

@ -166,6 +166,12 @@ public:
return position >= start && position < end;
}
/** Returns the nearest value to the one supplied, which lies within the range. */
ValueType clipValue (const ValueType value) const throw()
{
return jlimit (start, end, value);
}
/** Returns true if the given range intersects this one. */
bool intersects (const Range& other) const throw()
{

View file

@ -327,12 +327,12 @@ void Font::getGlyphPositions (const String& text, Array <int>& glyphs, Array <fl
}
}
void Font::findFonts (OwnedArray<Font>& destArray) throw()
void Font::findFonts (Array<Font>& destArray) throw()
{
const StringArray names (findAllTypefaceNames());
for (int i = 0; i < names.size(); ++i)
destArray.add (new Font (names[i], defaultFontHeight, Font::plain));
destArray.add (Font (names[i], defaultFontHeight, Font::plain));
}

View file

@ -322,7 +322,7 @@ public:
@param results the array to which new Font objects will be added.
*/
static void findFonts (OwnedArray<Font>& results) throw();
static void findFonts (Array<Font>& results) throw();
/** Returns a list of all the available typeface names.