57 if ([
self class] != [
CPString class])
66 - (CGSize)_sizeWithFont:(
CPFont)aFont inWidth:(
float)aWidth
76 if (sizeCacheForFont === undefined)
83 cacheKey = cssString + '_' + aWidth;
85 size = sizeCacheForFont[cacheKey];
87 if (size !== undefined && sizeCacheForFont.hasOwnProperty(cacheKey))
88 return CGSizeMakeCopy(size);
99 if (fontHeight === undefined)
105 sizeCacheForFont[cacheKey] = size;
107 size = CGSizeMake(0, 0);
109 return CGSizeMakeCopy(size);
112 - (CGSize)sizeWithFont:(
CPFont)aFont inWidth:(
float)aWidth
114 var size = [
self _sizeWithFont:aFont inWidth:aWidth];
115 return CGSizeMake(CEIL(size.width), size.height);