MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / FontFace

Function FontFace

src/utils.cpp:221–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219#endif
220
221wxString FontFace(std::string opt_prefix) {
222 opt_prefix += "/Font Face";
223 auto value = OPT_GET(opt_prefix)->GetString();
224#ifdef __WXOSX_COCOA__
225 if (value.empty()) {
226 auto default_font = CTFontCreateUIFontForLanguage(kCTFontUserFontType, 0, nullptr);
227 auto default_font_name = CTFontCopyPostScriptName(default_font);
228 CFRelease(default_font);
229
230 auto utf8_str = CFStringGetCStringPtr(default_font_name, kCFStringEncodingUTF8);
231 if (utf8_str)
232 value = utf8_str;
233 else {
234 char buffer[1024];
235 CFStringGetCString(default_font_name, buffer, sizeof(buffer), kCFStringEncodingUTF8);
236 buffer[1023] = '\0';
237 value = buffer;
238 }
239
240 CFRelease(default_font_name);
241 }
242#endif
243 return to_wx(value);
244}
245
246static agi::fs::path FileSelector(wxString const& message, std::string const& option_name, std::string const& default_filename, std::string const& default_extension, std::string const& wildcard, int flags, wxWindow *parent) {
247 wxString path;

Callers 4

UpdateStyleMethod · 0.85
SetStylesMethod · 0.85
PaintTrackCursorMethod · 0.85
AudioKaraokeMethod · 0.85

Calls 1

to_wxFunction · 0.70

Tested by

no test coverage detected