![]() |
|
SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
One UI font is different on Linux vs Windows
I noticed this issue years ago on V7, and it still exists today in V9 even after fixing the FreetypeFont library issue in Linux which is in the latest V9 build (9.0.4.232).
Almost all of the fonts look identical on both platforms (menus, popups, etc), except for the font that is used for the Program Guide, Recording Detail, and System Information screens, and also the video timestamp bar (when FF/REW recordings) and possibly a few other places. Can anyone offer some clues as to where to look to track down and fix this difference? I'm wondering if something is missing in the Linux build or OS and maybe SageTV is reverting to a default font. Or maybe the requested font name exists on both platforms but is not the same font? I checked the SageTV fonts directory on both platforms and the same files exist on each. I can add photos of the UI if that would help. I'm using HD200 extenders in case that matters. Thanks!
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7 |
#2
|
||||
|
||||
If you grep for "Rendered new font to cache" in the logs, then it should print out all the fonts being used. Then you may be able to spot something different. If that doesn't yield anything...then there's plenty of more advanced ways to figure it out I can suggest.
![]()
__________________
Jeffrey Kardatzke Founder of SageTV |
#3
|
|||
|
|||
I captured the "rendered" log entries on the two platforms when opening the Program Guide. The "descent" and "leading" values are different on Linux vs Windows:
Sage 7 Windows: Code:
Wed 3/2 13:26:07.940 [FinalRender-001d6a4bfae8@1fa1df7] Rendered new font to raw cache index=0 font=MetaFont[fonts\DejaVuSans, size=17, style=0, height=20.0, ascent=16.0, descent=5.0, leading=-1.0, class=class sage.FreetypeFont] Wed 3/2 13:26:07.959 [FinalRender-001d6a4bfae8@1fa1df7] Rendered new font to raw cache index=0 font=MetaFont[fonts\DejaVuSansMono, size=17, style=0, height=20.0, ascent=16.0, descent=5.0, leading=-1.0, class=class sage.FreetypeFont] Code:
Thu 3/3 16:45:04.947 [FinalRender-001d6a4bfae8@10a57a0] Rendered new font to raw cache index=0 font=MetaFont[fonts\DejaVuSans, size=17, style=0, height=20.0, ascent=16.0, descent=5.0, leading=-1.0, class=class sage.FreetypeFont] Thu 3/3 16:45:04.969 [FinalRender-001d6a4bfae8@10a57a0] Rendered new font to raw cache index=0 font=MetaFont[fonts\DejaVuSansMono, size=17, style=0, height=20.0, ascent=16.0, descent=5.0, leading=-1.0, class=class sage.FreetypeFont] Code:
Wed 3/2 13:21:10.228 [FinalRender-001d6a4bfae8@3e531466] Rendered new font to raw cache index=0 font=MetaFont[fonts/DejaVuSans, size=17, style=0, height=20.0, ascent=16.0, descent=4.0, leading=0.0, class=class sage.FreetypeFont] Wed 3/2 13:21:10.242 [FinalRender-001d6a4bfae8@3e531466] Rendered new font to raw cache index=0 font=MetaFont[fonts/DejaVuSansMono, size=17, style=0, height=20.0, ascent=16.0, descent=4.0, leading=0.0, class=class sage.FreetypeFont]
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7 |
#4
|
||||
|
||||
That's really weird. Leading is calculated from ascent, descent and height...so really the only difference is in descent. Which is pulled directly from Freetype, which reads it from the font. So this would make me think that this is either built against a different version of Freetype on each platform...or there's different .ttf files for the fonts on each platform (or there's something else in Freetype which is platform dependent; but I highly doubt that).
I would be curious to see pictures of how they look different. ![]()
__________________
Jeffrey Kardatzke Founder of SageTV |
#5
|
|||
|
|||
Thanks for the help. You're right, the difference is very subtle but I'm convinced it looks nicer in Windows.
![]() One thing I discovered by checking all of the open files for the JVM process in Linux (via /proc/<PID>/fd) is that all of the TTF files that are open are coming from /usr/share/fonts. None of the files under <SAGETV_SERVER>/fonts are used. I'm not too familiar with the font environment in Linux but it appears to be happening because the search directories are defined in /etc/fonts/fonts.conf like this: Code:
<dir>/usr/share/fonts</dir> <dir>/usr/share/X11/fonts/Type1</dir> <dir>/usr/share/X11/fonts/TTF</dir > <dir>/usr/local/share/fonts</dir> <dir prefix="xdg">fonts</dir> <!-- the following element will be removed in the future --> <dir>~/.fonts</dir> I'll try a few more experiments to see what else I can find.
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7 |
#6
|
|||
|
|||
The problem seems to be related to the version of FreeType and some changes in the way the rendering is done in v2.4.0 and higher (I think because the bytecode interpreter was enabled in 2.4.0). I found an easy fix to get the same looking fonts on all versions, but first let me explain what I tested...
On Linux, the libFreetypeFontJNI.so is not static so it uses whatever FT version is installed on the system (in my case 2.4.11, and my old Linux system from years ago that I remember seeing this had 2.4.4). On Windows it's a static library and I think you built it with FreeType 2.1.10 because opening the DLL in a text editor reveals some build paths containing "2.1.10". I did a bunch of tests--deleting the fontcache files before each test. Using FT 2.1.10 on Linux makes everything look like it does in Windows. Same with 2.3.12. Starting with 2.4.0 the fonts are smaller, and then in 2.4.6 the line spacing changes slightly (apparently due to a bug fix added in 2.4.6). The latest FT 2.6.3 looks the same as 2.4.6. In versions <2.4.6, the descent and leading values are the same as in 2.1.10 and 2.3.12 for the Program Guide fonts. In 2.4.6 and higher, they switch from 5/-1 to 4/0. Interestingly this does not cause much of a difference visually except for a slight line spacing difference which I only notice on the System Information screen. The major issue of the smaller font size in the UI occurs with 2.4.0 and all higher versions. I researched this and found quite a few cases in which people had similar issues starting with 2.4. The common workaround/fix seems to be to force the "autohint" method so the fonts are rendered the same way they were in older versions. The following change in the native library fixes the issue for me and now the UI fonts are the same size with every FT version from 2.1.10 to 2.6.3 that I tested (2.1.10, 2.3.9, 2.3.12, 2.4.0, 2.4.4, 2.4.6, 2.4.11, 2.6.3) and look the same as in Windows. Code:
--- sage_FreetypeFont.c.20160304 2016-02-18 14:49:16.030211179 -0500 +++ sage_FreetypeFont.c 2016-03-04 02:30:08.283010650 -0500 @@ -243,7 +243,7 @@ //FT_Face face = (FT_Face) facePtr; FTDataStruct* fontData = (FTDataStruct*)(intptr_t) fontPtr; FT_Activate_Size(fontData->sizePtr); - int error = FT_Load_Glyph(fontData->facePtr, glyphCode, FT_LOAD_DEFAULT); + int error = FT_Load_Glyph(fontData->facePtr, glyphCode, FT_LOAD_FORCE_AUTOHINT); if ((fontData->style & FT_STYLE_FLAG_BOLD) != 0) { // Apply bold effect
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7 Last edited by troll5501; 03-04-2016 at 12:16 PM. |
#7
|
||||
|
||||
Wow...I'm amazed you noticed a difference like that...even with all my super font pickiness I found it really hard to see the difference. Impressive.
![]() ![]()
__________________
Jeffrey Kardatzke Founder of SageTV |
#8
|
||||
|
||||
Quote:
![]() ![]()
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#9
|
|||
|
|||
Quote:
I guess my vision is still pretty good ![]()
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7 |
#10
|
|||
|
|||
Quote:
Quote:
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7 |
#11
|
|||
|
|||
I created a pull request for this change.
Please note: to get the full effect of this fix on an existing system with FT 2.4.0 or higher, the files in the SageTV fontcache directory will need to be deleted after applying the fix so the font cache files can be re-created with the new rendering.
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7 |
#12
|
|||
|
|||
Quote:
- where is the fontcache directory found as I do not see one on my system under SageTV - is a change still needed for "/etc/fonts/fonts.conf" and if so what is that change ? I did notice that the font on the Gemstone Main Menu is different between Windows and Linux so I will need to understand how the fonts are used in Linux to see what needs to be done to resolve. Perhaps the font in the STVs/SageTV7/Themes/Gemstone/Fonts are not being used on Linux (even though the fonts are defined in the Gemstone theme file). Thanks k
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page |
#13
|
|||
|
|||
Quote:
Code:
[sagetv@sagelinux server]$ pwd /opt/sagetv/server [sagetv@sagelinux server]$ ls -al | grep font drwxrwxr-x. 2 sagetv sagetv 4096 Mar 5 16:25 fontcache drwxrwxr-x. 2 sagetv sagetv 4096 Jan 30 18:12 fonts If you want to force the SageTV font files to be used, you can modify the following section in /etc/fonts/fonts.conf, remove the existing entries, and put in only <dir>/opt/sagetv/server/fonts</dir> (or whatever your SageTV fonts path is) and then restart SageTV. But this may cause issues with other Linux X-windows apps if you use any. This example is from CentOS 7: Code:
<!-- Font directory list --> <dir>/usr/share/fonts</dir> <dir>/usr/share/X11/fonts/Type1</dir> <dir>/usr/share/X11/fonts/TTF</dir> <dir>/usr/local/share/fonts</dir> <dir prefix="xdg">fonts</dir> <!-- the following element will be removed in the future --> <dir>~/.fonts</dir>
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7 |
#14
|
|||
|
|||
Quote:
I have a fonts one but not the other. I am on Ubuntu 14.04.3 LTS k
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page |
#15
|
|||
|
|||
Can you enable debug logging (if it's not already enabled) and grep your sagetv_0.txt log for "font" and "Font"? Ideally check the logfile after restarting Sage and after connecting from one of your clients.
I'm assuming it creates the directory automatically, so I'm wondering if the ownership/permissions of your SageTV server directory is causing an issue?
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7 |
#16
|
|||
|
|||
Quote:
Attached are the grep results for "font" in my sagetv_0.txt log file after a fresh start and then starting an HD300. PS: if you need me to check something else let me know....but I am VERY new to linux so keep that in mind. k
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page |
#17
|
|||
|
|||
Quote:
Code:
Sat 3/19 13:46:09.198 [MiniUIServerConnection@6a0172c1] Error loading Freetype Font; trying to load Java font instead; error=java.lang.UnsatisfiedLinkError: sage.FreetypeFont.loadFreetypeLib0()J ...18 more of the same error Sat 3/19 13:46:13.394 [MiniUIServerConnection@6a0172c1] Error loading Freetype Font; trying to load Java font instead; error=java.lang.UnsatisfiedLinkError: sage.FreetypeFont.loadFreetypeLib0()J https://github.com/google/sagetv/com...a773bbb5b3e5fa This fix should have been included the 232 build/release, but I'm not sure if the Linux tar and deb files were only updated with the new Sage jar file or if the other components (native, etc.) were also recompiled--the fix was for libFreetypeFontJNI.so. 232 should also contain an updated ffmpeg to fix the thumbnail creation issue. Which version are you running, and if it's 232 how did you install (or upgrade) it?
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7 |
#18
|
|||
|
|||
Quote:
Thanks for looking into this and pointing me in the right direction. k
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page |
#19
|
|||
|
|||
Glad that everything is working for you now! I'll be interested to know if you see any difference with the latest fix that addresses the issue at the top of this thread. But you'll need to rebuild the libFreetypeFontJNI.so from the latest source to test it.
__________________
Server: HP DL380 G6, VMware ESXi 5.0 with HW passthrough for USB and Firewire, 4 x HD-PVR, ZFS storage SageTV: Production: 7.1.9+Java 1.6.0_32 on XP, Test: 9.0.4.291+Java 1.8.0_72 on Linux 64-bit Clients: 2 x Sage HD200 Extender, 1 x Sage HD100 Extender Sources: 4 x Motorola DCH-3200 (firewire channel changing), HD Homerun Prime, OpenDCT 0.5.7 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Freetype Font UnsatisfiedLinkError in Linux | troll5501 | SageTV Github Development | 4 | 02-10-2016 01:14 PM |
Windows 7 RC Large font at 1080p problem | SWKerr | SageTV Software | 3 | 12-24-2010 02:18 AM |
Windows or Linux for v7? | surge | SageTV Beta Test Software | 8 | 12-12-2010 02:03 PM |
Linux (Ubuntu 7.10) - Placeshifter font too long | ltitran | SageTV Linux | 9 | 04-09-2008 06:00 AM |
Windows --> Linux | ChePazzo | SageTV Linux | 1 | 10-31-2006 09:15 AM |