*/
+#include "dcpomatic_button.h"
#include "fonts_dialog.h"
-#include "wx_util.h"
#include "system_font_dialog.h"
-#include "dcpomatic_button.h"
-#include "lib/font.h"
+#include "wx_util.h"
#include "lib/content.h"
+#include "lib/font.h"
#include "lib/text_content.h"
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
#include <wx/wx.h>
-#include <iostream>
+LIBDCP_ENABLE_WARNINGS
#include <memory>
using std::list;
-using std::string;
-using std::cout;
using std::shared_ptr;
+using std::string;
using namespace dcpomatic;
wxListItem item;
item.SetId (n);
_fonts->InsertItem (item);
- _fonts->SetItem (n, 0, std_to_wx (i->id ()));
+ auto const id = i->id().empty() ? _("Unspecified") : std_to_wx(i->id());
+ _fonts->SetItem(n, 0, id);
+ _fonts->SetItemData(n, i->id().empty());
if (i->file()) {
- _fonts->SetItem (n, 1, i->file()->leaf().string ());
+ _fonts->SetItem(n, 1, i->file()->leaf().string());
}
++n;
}
}
int const item = _fonts->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- auto const id = wx_to_std (_fonts->GetItemText(item, 0));
- shared_ptr<Font> font;
- for (auto i: caption->fonts()) {
- if (i->id() == id) {
- font = i;
- }
- }
-
+ auto const id = _fonts->GetItemData(item) ? "" : wx_to_std(_fonts->GetItemText(item, 0));
+ auto font = caption->get_font(id);
if (!font) {
return;
}