Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c29eb197d1
Fetching contributors…

Cannot retrieve contributors at this time

47 lines (38 sloc) 1.583 kb
/*
Copyright © 2005-2011 Brian S. Hall
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 or later as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Carbon/Carbon.h>
typedef struct
{
CGFloat height;
CGFloat width;
CGFloat ascent;
CGFloat descent;
CGFloat baseline;
Boolean fontSupported;
} TRInfo;
typedef enum
{
TRSubstituteFallbackBehavior,
TRLastResortFallbackBehavior,
TRNoRenderFallbackBehavior
} TRFallbackBehavior;
OSStatus TRGetBestFontSize(CGContextRef ctx, CGRect r, CFStringRef string,
CFStringRef fontName,
TRFallbackBehavior fallbackBehavior,
CGFloat* oFontSize, CGFloat* oBaseline);
OSStatus TRGetTextInfo(CGContextRef ctx, CGRect r, CFStringRef string,
CFStringRef fontName, CGFloat fontSize,
TRFallbackBehavior fallbackBehavior, TRInfo* oInfo);
OSStatus TRRenderText(CGContextRef ctx, CGRect r, CFStringRef string,
CFStringRef fontName, CGFloat fontSize,
TRFallbackBehavior fallbackBehavior, CGFloat baseline);
Jump to Line
Something went wrong with that request. Please try again.