Skip to content

Instantly share code, notes, and snippets.

@ftake
ftake / gist:75e4b2931ab88fac2944
Created March 18, 2015 14:16
my tex preamble
%
% BEGEIN additional packages and macros
%
% draft only
\pagestyle{plain}
% end
\newenvironment{syntax}{\setlength{\baselineskip}{12pt} \begin{quote} \flushleft \ttfamily }{\end{quote}}
\newcommand{\lb}[0]{\texttt{\symbol{"7B}}}%"
@ftake
ftake / gist:8397208
Last active January 3, 2016 02:39
How to get localized font names with the CoreText API
#include <iostream>
#include <CoreText/CTFont.h>
#include <CoreText/CTFontCollection.h>
#include <CoreFoundation/CFString.h>
#include <CoreFoundation/CFBase.h>
void callBack(const void *value, void *context) {
CTFontDescriptorRef pDesc = static_cast<CTFontDescriptorRef>(value);
CFStringRef pFamilyName = (CFStringRef)CTFontDescriptorCopyAttribute(pDesc, kCTFontFamilyNameAttribute);