Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font Enhancements #44

Open
ZeroCoolGOS opened this issue Mar 6, 2021 · 34 comments
Open

Font Enhancements #44

ZeroCoolGOS opened this issue Mar 6, 2021 · 34 comments

Comments

@ZeroCoolGOS
Copy link

ZeroCoolGOS commented Mar 6, 2021

Due to the growing popularity to the font system. there are a few enhancements I would like to make to the system.

  1. Add "Clear Fonts" to clear out all custom uploaded fonts.

  2. Add a check to see if a font file is supported within a zip file

  3. Add support for multiple font formats (eg. OTF)

  4. Update the "Unzip" to not unzip to the root of the fonts folder but to unzip to its "Zip File Name" for better organization

  5. Using the "Zip File Name" folder method, append the name to the actual name of the font file when displaying in the lists. Currently it only uses the name of the font file itself and and can become a bit harder to identify the type we require.

  6. When unzipping the fonts, only unzip the font files supported and ignore all other files and folders. This will allow for a cleaner storage and organization.

  7. Remove _MACOSX folder when unzipping.

** EDIT **
2021-03-24:

  • Find all 'hard coded' font path and replace with $pmpFontDir
  • Add option to delete individual 'fonts'
  • Add 'fail over' for when font is cleared but set to active if the font does not exist then default to standard font.
@titelies
Copy link

Not sure how to get my custom font working again after updating 2.10. Left fonts folder alone, ran update, when rebooted fonts on MPD showed as generic in sample on page and also on Poster TV. Deleted all font folders within /var/www/html/cache/fonts, used the Browse and Upload of my saved Bundle but it's still generic font type. Any advice would be appreciated.

@ZeroCoolGOS
Copy link
Author

How did you run your update?

Can you check to see what is now in the fonts folder and let me know if it unpacked correctly via the Browser?

@ZeroCoolGOS
Copy link
Author

I think I see the issue your seeing. I'm digging into it now.

@titelies
Copy link

After doing the update, the fonts weren't working so I went into the cache/fonts folder and removed each of the font folders and just left the fonts_custom.css file. I then used the Browse and Upload of my downloaded bundle and the font folders will all put back into the cache/fonts folder but it still has a generic font and not the one selected from the dropdown menu.

@ZeroCoolGOS
Copy link
Author

Ya, im now seeing that too. I'm working on tracking down the bug.

@ZeroCoolGOS
Copy link
Author

I have submitted a PR for @MattsShack to approve that contains the font display fix. It will be in build 2.10.1

@titelies
Copy link

Outstanding! Do I need to empty the fonts folder or leave the way it is now with all of the font folders and the fonts_custom.css file?
Will I need to do a Browse & Upload of the font bundle again?

@ZeroCoolGOS
Copy link
Author

No. You should not need to empty and re-upload your font folder.

The fonts_custom.css gets regenerated when you hit the fonts page so just navigate to that and it should refresh.

I am also experimenting with a "FULL BACKUP" to also backup the fonts and the config files. So in future that will be easier to move around and update.

@ZeroCoolGOS
Copy link
Author

@titelies
v2.10.1 should now be ready and should fix your font problem.

@titelies
Copy link

titelies commented Mar 10, 2021

Spectacular! Thanks again Geoff... once the top text vertical alignment is resolved... Coming Soon will be perfect! Thank you sir!

@ZeroCoolGOS
Copy link
Author

No problem.

What font and font size are you using so I can try and us that to test against for the Now Showing?

Also are you having the issue with Coming Soon?

I will try and get to this issue this week and have a PR for Matt next week as he mentioned to me that he is out of town this week, so I don't want to bother him too much and just stack up the fixes.

@titelies
Copy link

I edited my comment, I meant the Coming Soon but obviously I use the same font and size for the Now Showing as well. I am using the Avengers font: https://famfonts.com/avengers-movie/ After adjusting overscan in /boot/config.txt it got better but I just have to use a smaller font than I would like. Currently, using size 100 but I think if the alignment were in the center and not at the top, I believe 130 or 140 might fit. And the specific custom font is called AVENGEANCE HEROIC AVENGER BI
With the larger top font: https://i.imgur.com/NABadBM.jpg
with the 100 font: https://i.imgur.com/5W47eni.jpg (and it's right at the edge of the top of the screen)

@ZeroCoolGOS
Copy link
Author

Cool.

I will give it a try. I am not currently working with the RPi at this time, so I have not been playing with the boot/config file so I will see when it comes to at the code level vs hardware level

@ZeroCoolGOS
Copy link
Author

@titelies

After further investigation I have determined that the font is actually centered. The issue is the field that the text in is set to 10% of the display so with such a large font size it exceeds the 10% threshold.

I am looking at different options for workarounds.

Keeping the 10/80/10 ratio is the most ideal. If I was to scale up the title, then I would have to scale down the poster itself and I don't think that would be a look we are going for. So I think the best way would be to scale down if it exceeds the 10% threshold.

I have tested on 3 devices and get 3 different results so the font display is inconsistent anyways due to size.

Still more research is required.

@titelies
Copy link

I completely agree with the 10/80/10 but that's still strange, only cause I am running the same font and size on the top and bottom and the bottom one looks perfect but the top text is right on the edge of the top of the screen (left edge, if TV were mounted horizontally). The bottom text size 100 has more words and perfectly centered horizontally and vertically while the top isn't. Weird! Thanks for looking into it.

@ZeroCoolGOS
Copy link
Author

@titelies
I am still working on the font "center" issue

But with this build (2.10.2) you will now be able to use the Mr Robot font and other fonts that are otf files.

The file upload will not (yet) allow you to upload the file individually but you will be able to use the zip file.

Also just as a note: You can always export your uploaded fonts into a single zip file for a later restore so you dont have to add one at a time.

Use the "Download Bundle" option.

Since its also a zip file you can fully modify that zip and create your own bundle and restore that.

@titelies
Copy link

@ZeroCoolGOS Sounds good Geoff. Looking forward to the alignment fix at some point 💯 I like the generate bundle feature for the Fonts, just as a backup and restore. When version 3 becomes available it's going to be outstanding! I unfortunately don't have the skills to do what you do but testing and quality assurance I can handle. 🥇

@ZeroCoolGOS
Copy link
Author

I'm just learning as I go.

But ya, the more people test helps us fix bugs we may miss.

I don't know how the v3 thing is working as this is referring v3 but it's been versioned as v2.

I just keep processing and trying to make things better for everyone.

@titelies
Copy link

@ZeroCoolGOS Noticed that the Movie Poster Display Footer link to the Github page was mixed in with my Installed fonts and samples instead of at the bottom of the page. https://i.imgur.com/sgBq9Gk.png

@ZeroCoolGOS
Copy link
Author

Yup. I saw that too and will be fixed in the next push.

ZeroCoolGOS added a commit to ZeroCoolGOS/Plex-Movie-Poster-Display that referenced this issue Mar 13, 2021
Enhancement - Font Enhancements (Issue MattsShack#44)
- Update export to unzip into subdirectory for better organization.
- Add font extraction for only font files
- Expand font scanner for multiple font files and added to font_custom.css
- Fix duplicate entries in font_custom.css

    Design:
    1. __Complete__: Add 'Clear Fonts' to clear out all custom uploaded fonts.
    2. __Canceled__: Add a check to see if a font file is supported within a zip file
    3. __Complete__: Add support for multiple font formats (eg. OTF)
    4. __Complete__: Update the 'Unzip' to not unzip to the root of the fonts folder but to unzip to its 'Zip File Name' for better organization
    5. __TODO__: Using the 'Zip File Name' folder method, append the name to the actual name of the font file when displaying in the lists. Currently it only uses the name of the font file itself and and can become a bit harder to identify the type we require.
    6. __Complete__: When unzipping the fonts, only unzip the font files supported and ignore all other files and folders. This will allow for a cleaner storage and organization.
    7. __Canceled__: Remove _MACOSX folder when unzipping.

Coming Soon - Show Media: ALL - Not Displaying TV Show Posters (Issue MattsShack#51)
- Add logic to address when in 'Coming Soon' and either 'All' or 'Unwatched' would not display poster when set to 'series' or 'season'.
- When using 'All' or 'Unwatched' the cover poster for the series is used even though Episode/Season/Series may be selected.  This is based on the xml data provided by the PLEX API
- Disable Episode/Season/Series option when using 'All' or 'Unwatched' is set for Coming Soon

Scrolling Summary Bottom Text for Now Showing (Issue MattsShack#39)
- Fix issue with summary display on single line - Unreadable
- Add bottomScroll for text to be individually controlled in 'Now Showing' and 'Coming Soon'
- TODO: Remove the 'Common' version of 'bottomScroll'

Updates and Bug Fixes:
- Add logging to import Zip File
- Updates to test suite
- Fix issue with 'GeneralPath_Remove' not running correctly as no default values where provided.
- Update documentation to reflect some changes that has been made to the system. (Issue MattsShack#52)
- Modify CSS for userText, disabling the 'white-space: nowrap' element as it was causing issues with how the text was displaying.

Known Issues:
- If summary text is too large and bottom scroll is disabled, summary becomes unreadable.
@titelies
Copy link

Seem to still have issues with the Custom Fonts... Blade Runner, Terminator, Tron which are .TTF fonts still shows up as generic fonts. Mr. Robot .OTF caused the Nginx Bad Gateway error again until I removed the folder and rebooted. I'm assuming 'Clear Fonts' you mentioned in the updates refers to the Clear Cache button for fonts, not sure when to use that exactly or if I need to...

@ZeroCoolGOS
Copy link
Author

Ok. I will try those fonts for testing.

I used the mr robot font and it was working so I am not sure why your getting the bad gateway. I will have to do more investigation. I am not currently testing on an RPi directly so I wonder if it's a direct hardware issue.

Also sometimes it helps to clear the browser cache for the fonts to show up.

As for the clear fonts button, yes it's the "clear cache" for the fonts. I am not sure when someone might need it but it could come in handy. I used it for testing as I ran into a glitch and it helped me identify the glitch. Better to have it and not need it and need it and not have it.

Also depending on the implementation you may not have direct access to the files so this is another option.

@ZeroCoolGOS
Copy link
Author

ZeroCoolGOS commented Mar 13, 2021

It looks like the __MACOSX folder is extracting. I thought that would be addressed when I am only pulling the font files. I guess it is not.
Can you try and remove the __MACOSX again and see if it fixes the gateway problem?

I will make sure to remove that explicitly this time.

I am digging into why Tron, Terminator and Blade Runner fonts are not showing. I believe they where working in the past so I am not sure why the could be broken.

*** Edit ***

I know what the issue is with the other fonts. The file ext is uppercase where the CSS is lower case so I will look at how to address this issue.

@titelies
Copy link

I wondered if the issue was the CAPS, I should've mentioned it. So, if I manually change the name to lowercase, it will fix the issue? Going to give it a try and remove the MACOSX folder to see what occurs.

@ZeroCoolGOS
Copy link
Author

yes. If you lowercase the extension then that should fix it.

@titelies
Copy link

Tron and Mr Robot keep causing a Bad Gateway when trying to go back to the General page, even after removing the MACOSX folder. Removing those fonts after adding them gets rid of the Bad Gateway issue on the General page.

@ZeroCoolGOS
Copy link
Author

Interesting.

Sorry that it's  causing you issues. I will try and see what I can do and how I can get it fixed.

@ZeroCoolGOS
Copy link
Author

I am now seeing the bad gateway issues and I am trying to chip away at them. Hope to have a fix by the end of the weekend.

ZeroCoolGOS added a commit to ZeroCoolGOS/Plex-Movie-Poster-Display that referenced this issue Mar 15, 2021
Coming Soon - Show Media: ALL - Not Displaying TV Show Posters (Issue MattsShack#51)
- Add a more documentation around when using Unwatched and All for show media that the poster will default to the Series poster.

Updates and Bug Fixes:
- Address nginx errors in error log (tail /var/log/nginx/error.log)
- Address issues with 'Bad Gateway' (Issue MattsShack#44)
- Add more misc. logging information
- Add missing fields in config.php
@titelies
Copy link

Font issues and Bad Gateway seemed to be solved. As always, thank you for the updates @ZeroCoolGOS !

@titelies
Copy link

titelies commented Mar 15, 2021

So, I am able to upload new fonts using the Font Config without Bad Gateway error. However, it looks like any of the new fonts I test, no matter what filetype, will produce a generic font. Terminator, Tron, Mr. Robot, Ghostbusters, Knight Rider, Godzilla, Friday the 13th, The Crow, etc. Should I Clear Font Cache and try again?

Also, when I first uploaded them on Font Config page the Samples were previewing correctly with the desired font, now the new fonts have all changed to generic font sample previews. https://i.imgur.com/ADL20Ex.png

@ZeroCoolGOS
Copy link
Author

That is odd.

I know that some fonts don't show up as nice as they should for some text. I would try a Ctrl+F5 to see if it clears the preview up.

If that does not work, try and clear the fonts and re add them.

And if that still does not work. please provide the font_custom.css so I can review how its generating for you to make sure that its coming out correctly.

I just uploaded a few of the fonts mentioned and most seemed to work for me.
image

@titelies
Copy link

The Font Clear Cache and Import worked!

@ZeroCoolGOS
Copy link
Author

ZeroCoolGOS commented Mar 15, 2021

Good.

You should not need to do that but its good that that worked.

ZeroCoolGOS added a commit to ZeroCoolGOS/Plex-Movie-Poster-Display that referenced this issue Mar 16, 2021
Enhancement - Font Enhancements (Issue MattsShack#44)
- Add flag for files with '._' as there name.  Future update should remove these files directly.
- Add a more dynamic font css generation to only add the 'fonts' that truly exist.  Any fonts that have the same font with multiple ext. will need to be validated.

Updates and Bug Fixes:
- Update to ChangeLog for v2.10.3 as missing additional information.
- Move getPoster from to plexMoviePoster assets.  This is to help isolate potential issues with relative paths.
- Update how to handle issues with the getPoster functions when receiving invalid image.

Trouble Shooting:
- If poster is not returning correctly, attempt to reinstall dependencies.  Sometimes issue could be because of an issue with the pmp-curl dependency.
@ZeroCoolGOS
Copy link
Author

ToDo:

  • Add Fix for when font = None that it defaults back to system font not generic font.

ZeroCoolGOS added a commit to ZeroCoolGOS/Plex-Movie-Poster-Display that referenced this issue Mar 19, 2021
Enhancement - Font Enhancements (Issue MattsShack#44)
- Add Fix for when font = None that it defaults back to system font not generic font.

Enhancement - Digital Picture Frame Mode (Issue MattsShack#48)
- Separate timer to give timer to each one of the types of display options.
- Cleanup javascript to use switch case vs. if statement to better organize load options, and to allow for future data promotion to the front end.
- Update to how the index page takes in changes to refresh time. Previously if a refresh time was set and you load index page that refresh was locked in until you did a full page reload. Now, if refresh is adjusted the page will validate and if the current and new refresh times are out of sync the page will do a full reload
- Add some hooks for Digital picture frame to disable CSS blur

ToDo:
- Look into moving index JavaScripts to dedicated js file for better reuse of functions as a good portion are duplicated.

Known Bugs:
- For page refresh if out of sync there may be a poster flash/skip as its loading the new 'session'

Updates and Bug Fixes:
- Disable frontend for 'Poster Transition/Refresh Speed' and 'Bottom Scrolling Text' options in the 'Common Configuration' page as these options are now available as individuals for the 'Coming Soon' and 'Now Showing' pages.
- Add more Plex API metadata read. Collecting content rating and if nowPlaying is directplay or transcode, also getting information on video and audio codecs.
- Update log system to better organize logs. First isolate PLEXLib logs to PLEX isolated log files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants