From db3754d8d6f93e37edf4238dc1b9b0de62963b47 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Tue, 10 Dec 2019 14:57:13 -0800 Subject: osc: use custom symbols for window controls I was recently informed that unicode has official symbols for window controls, and I put together a change to use them, which worked, as long as a suitable font was installed. However, it's not that hard to get a normal system that lacks an appropriate font, and libass wants to print warnings if the symbols aren't in the default font, which will almost always be true. So, I gave up and added the symbols to the custom osd font that we already have. This ensures they are always available, and that they are aligned consistently on all platforms. I took the symbols from the `symbola` font, as this has a suitable licence and the symbols look nice enough. Symbola Licence: Fonts are free for any use; they may be opened, edited, modified, regenerated, packaged and redistributed. Finally, as we now have access to an un-maximize symbol, I added logic to use it when the window is maximized. --- TOOLS/mpv-osd-symbols.sfdir/font.props | 2 +- TOOLS/mpv-osd-symbols.sfdir/uniE112.glyph | 15 +++++++++++++++ TOOLS/mpv-osd-symbols.sfdir/uniE113.glyph | 20 ++++++++++++++++++++ TOOLS/mpv-osd-symbols.sfdir/uniE114.glyph | 31 +++++++++++++++++++++++++++++++ TOOLS/mpv-osd-symbols.sfdir/uniE115.glyph | 27 +++++++++++++++++++++++++++ 5 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 TOOLS/mpv-osd-symbols.sfdir/uniE112.glyph create mode 100644 TOOLS/mpv-osd-symbols.sfdir/uniE113.glyph create mode 100644 TOOLS/mpv-osd-symbols.sfdir/uniE114.glyph create mode 100644 TOOLS/mpv-osd-symbols.sfdir/uniE115.glyph (limited to 'TOOLS/mpv-osd-symbols.sfdir') diff --git a/TOOLS/mpv-osd-symbols.sfdir/font.props b/TOOLS/mpv-osd-symbols.sfdir/font.props index 17668f93d9..8198d27e62 100644 --- a/TOOLS/mpv-osd-symbols.sfdir/font.props +++ b/TOOLS/mpv-osd-symbols.sfdir/font.props @@ -22,7 +22,7 @@ OS2Version: 3 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 0 CreationTime: 1408646554 -ModificationTime: 1492879730 +ModificationTime: 1576096543 PfmFamily: 81 TTFWeight: 400 TTFWidth: 5 diff --git a/TOOLS/mpv-osd-symbols.sfdir/uniE112.glyph b/TOOLS/mpv-osd-symbols.sfdir/uniE112.glyph new file mode 100644 index 0000000000..90c29c27d3 --- /dev/null +++ b/TOOLS/mpv-osd-symbols.sfdir/uniE112.glyph @@ -0,0 +1,15 @@ +StartChar: uniE112 +Encoding: 57618 57618 30 +Width: 768 +VWidth: 1176 +Flags: HW +LayerCount: 2 +Fore +SplineSet +512 40 m 1 + 0 40 l 1 + 0 168 l 1 + 512 168 l 1 + 512 40 l 1 +EndSplineSet +EndChar diff --git a/TOOLS/mpv-osd-symbols.sfdir/uniE113.glyph b/TOOLS/mpv-osd-symbols.sfdir/uniE113.glyph new file mode 100644 index 0000000000..6319b8f5d9 --- /dev/null +++ b/TOOLS/mpv-osd-symbols.sfdir/uniE113.glyph @@ -0,0 +1,20 @@ +StartChar: uniE113 +Encoding: 57619 57619 31 +Width: 622 +VWidth: 1178 +Flags: HW +LayerCount: 2 +Fore +SplineSet +768 42 m 5 + 0 42 l 5 + 0 746 l 5 + 768 746 l 5 + 768 42 l 5 +704 106 m 5 + 704 618 l 5 + 64 618 l 5 + 64 106 l 5 + 704 106 l 5 +EndSplineSet +EndChar diff --git a/TOOLS/mpv-osd-symbols.sfdir/uniE114.glyph b/TOOLS/mpv-osd-symbols.sfdir/uniE114.glyph new file mode 100644 index 0000000000..36e6577f30 --- /dev/null +++ b/TOOLS/mpv-osd-symbols.sfdir/uniE114.glyph @@ -0,0 +1,31 @@ +StartChar: uniE114 +Encoding: 57620 57620 32 +Width: 896 +VWidth: 1178 +Flags: HW +LayerCount: 2 +Fore +SplineSet +768 298 m 1 + 576 298 l 1 + 576 42 l 1 + 0 42 l 1 + 0 490 l 1 + 192 490 l 1 + 192 746 l 1 + 768 746 l 1 + 768 298 l 1 +704 362 m 1 + 704 618 l 1 + 256 618 l 1 + 256 490 l 1 + 576 490 l 1 + 576 362 l 1 + 704 362 l 1 +512 106 m 1 + 512 362 l 1 + 64 362 l 1 + 64 106 l 1 + 512 106 l 1 +EndSplineSet +EndChar diff --git a/TOOLS/mpv-osd-symbols.sfdir/uniE115.glyph b/TOOLS/mpv-osd-symbols.sfdir/uniE115.glyph new file mode 100644 index 0000000000..10c11958d7 --- /dev/null +++ b/TOOLS/mpv-osd-symbols.sfdir/uniE115.glyph @@ -0,0 +1,27 @@ +StartChar: uniE115 +Encoding: 57621 57621 33 +Width: 844 +VWidth: 1112 +Flags: HW +LayerCount: 2 +Fore +SplineSet +671 40 m 1 + 575 40 l 1 + 335 277 l 1 + 98 40 l 1 + -1 40 l 1 + -1 136 l 1 + 236 376 l 1 + -1 613 l 1 + -1 712 l 1 + 98 712 l 1 + 335 475 l 1 + 575 712 l 1 + 671 712 l 1 + 671 613 l 1 + 434 376 l 1 + 671 139 l 1 + 671 40 l 1 +EndSplineSet +EndChar -- cgit v1.2.3