GDI和Pango都有一个规范字体权重列表,其范围为“薄,超轻,轻,正常,中等,半粗体,粗体,粗体,重”。它显示为CSS does too。
但是,我没有在OS X上看到Core Text(甚至NSFont / NSFontDescriptor)的字体列表。相反,我看到的是
from string import punctuation
with open('p.txt','r') as twts, open('q.txt','r') as words:
st = set(map(str.rstrip,words))
for line in twts:
if any(word.rstrip(punctuation) in st for word in line.split()):
print("Found at line {}".format(line))
,记录为从-1.0到1.0,其中0.0为“常规或中等”(所以正常和中等或只是中等?)和kCTFontWeightTrait
,其权重参数记录为从0到15,其中5为正常/书(我假设是在正常和正常之间,如果不正常),9和更高都是粗体那么上述规范体重名称的等价物是什么?感谢。
答案 0 :(得分:2)
规范名称在标题中给出:
userID = 5
return userID
userIDcopy = str(userID)
print "Welcome User "+userIDcopy
要了解他们的价值观,请依次记录每一个。
APPKIT_EXTERN const CGFloat NSFontWeightUltraLight NS_AVAILABLE_MAC(10_11);
APPKIT_EXTERN const CGFloat NSFontWeightThin NS_AVAILABLE_MAC(10_11);
APPKIT_EXTERN const CGFloat NSFontWeightLight NS_AVAILABLE_MAC(10_11);
APPKIT_EXTERN const CGFloat NSFontWeightRegular NS_AVAILABLE_MAC(10_11);
APPKIT_EXTERN const CGFloat NSFontWeightMedium NS_AVAILABLE_MAC(10_11);
APPKIT_EXTERN const CGFloat NSFontWeightSemibold NS_AVAILABLE_MAC(10_11);
APPKIT_EXTERN const CGFloat NSFontWeightBold NS_AVAILABLE_MAC(10_11);
APPKIT_EXTERN const CGFloat NSFontWeightHeavy NS_AVAILABLE_MAC(10_11);
APPKIT_EXTERN const CGFloat NSFontWeightBlack NS_AVAILABLE_MAC(10_11);