| 219 | #endif |
| 220 | |
| 221 | wxString 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 | |
| 246 | static 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; |
no test coverage detected