ctfonts.cxx (703fc9f0) | ctfonts.cxx (41145ab3) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 127 unchanged lines hidden (view full) --- 136 CFBooleanRef pCFVertBool = pReqFont->mbVertical ? kCFBooleanTrue : kCFBooleanFalse; 137 CFDictionarySetValue( mpStyleDict, kCTVerticalFormsAttributeName, pCFVertBool ); 138 139 CTFontDescriptorRef pFontDesc = (CTFontDescriptorRef)mpFontData->GetFontId(); 140 CTFontRef pNewCTFont = CTFontCreateWithFontDescriptor( pFontDesc, fScaledFontHeight, pMatrix ); 141 CFDictionarySetValue( mpStyleDict, kCTFontAttributeName, pNewCTFont ); 142 CFRelease( pNewCTFont); 143 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 127 unchanged lines hidden (view full) --- 136 CFBooleanRef pCFVertBool = pReqFont->mbVertical ? kCFBooleanTrue : kCFBooleanFalse; 137 CFDictionarySetValue( mpStyleDict, kCTVerticalFormsAttributeName, pCFVertBool ); 138 139 CTFontDescriptorRef pFontDesc = (CTFontDescriptorRef)mpFontData->GetFontId(); 140 CTFontRef pNewCTFont = CTFontCreateWithFontDescriptor( pFontDesc, fScaledFontHeight, pMatrix ); 141 CFDictionarySetValue( mpStyleDict, kCTFontAttributeName, pNewCTFont ); 142 CFRelease( pNewCTFont); 143 |
144 // handle emulation of bold styles if requested and the font that doesn't provide them 145 if( (pReqFont->meWeight > WEIGHT_MEDIUM) 146 && (mpFontData->meWeight <= WEIGHT_MEDIUM) 147 && (mpFontData->meWeight != WEIGHT_DONTKNOW)) 148 { 149 const int nBoldFactor = -lrint( (3.5F * pReqFont->meWeight) / mpFontData->meWeight); 150 CFNumberRef pCFIntBold = CFNumberCreate( NULL, kCFNumberIntType, &nBoldFactor); 151 CFDictionarySetValue( mpStyleDict, kCTStrokeWidthAttributeName, pCFIntBold); 152 } 153 |
|
144#if 0 // LastResort is implicit in CoreText's font cascading 145 const void* aGFBDescriptors[] = { CTFontDescriptorCreateWithNameAndSize( CFSTR("LastResort"), 0) }; // TODO: use the full GFB list 146 const int nGfbCount = sizeof(aGFBDescriptors) / sizeof(*aGFBDescriptors); 147 CFArrayRef pGfbList = CFArrayCreate( NULL, aGFBDescriptors, nGfbCount, &kCFTypeArrayCallBacks); 148 CFDictionaryAddValue( mpStyleDict, kCTFontCascadeListAttribute, pGfbList); 149 CFRelease( pGfbList); 150#endif 151} --- 507 unchanged lines hidden --- | 154#if 0 // LastResort is implicit in CoreText's font cascading 155 const void* aGFBDescriptors[] = { CTFontDescriptorCreateWithNameAndSize( CFSTR("LastResort"), 0) }; // TODO: use the full GFB list 156 const int nGfbCount = sizeof(aGFBDescriptors) / sizeof(*aGFBDescriptors); 157 CFArrayRef pGfbList = CFArrayCreate( NULL, aGFBDescriptors, nGfbCount, &kCFTypeArrayCallBacks); 158 CFDictionaryAddValue( mpStyleDict, kCTFontCascadeListAttribute, pGfbList); 159 CFRelease( pGfbList); 160#endif 161} --- 507 unchanged lines hidden --- |