Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
translations translations
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Wrapping a long title
« previous next »
  • Print
Pages: [1]

Author Topic: Wrapping a long title  (Read 276 times)

Offline mango

  • Member
  • *
  • Posts: 1
Wrapping a long title
« on: April 23, 2025, 03:42:35 AM »
I want to split a title across multiple lines on my WPS. With a monospaced font I could calculate the number of characters on a line and use %ss to split the title. Do you have any suggestions on how to do this with a variable width font?
Logged

Offline Dook

  • Member
  • *
  • Posts: 71
    • D00k.net
Re: Wrapping a long title
« Reply #1 on: April 23, 2025, 11:51:09 AM »
There is no straightforward method unfortunately. I do mine with some reasonable guestimates, check out my implementations in Themify and adwaitapod simplified.
Logged

Offline iPodVT

  • Member
  • *
  • Posts: 480
Re: Wrapping a long title
« Reply #2 on: April 23, 2025, 12:13:31 PM »
Quote from: mango on April 23, 2025, 03:42:35 AM
With a monospaced font I could calculate the number of characters on a line...

How would you do that?
Logged

Offline gnomacor

  • Member
  • *
  • Posts: 24
Re: Wrapping a long title
« Reply #3 on: April 25, 2025, 06:51:59 PM »
It kind of doesn't matter if it's variable width or not - you can slice it up regardless with a sensible number. You can check out wavy theme and it turns this up to 11: each and every letters are sliced positioned letter by letter. As Dook said there is no better way as of now.
Logged

Offline chronicallyoffline

  • Member
  • *
  • Posts: 8
Re: Wrapping a long title
« Reply #4 on: April 27, 2025, 12:56:29 PM »
Quote from: iPodVT on April 23, 2025, 12:13:31 PM
Quote from: mango on April 23, 2025, 03:42:35 AM
With a monospaced font I could calculate the number of characters on a line...

How would you do that?
From the CustomWPS page
 
%?if(%ss(0, 20, %it), =, %it)<track title length is 20 characters or less|track title length is over 20 characters>

I've attempted it, but the issue is there's no way to guarantee a break on a space unless there's some additional conditional wizardry we can do.
Logged

Offline Dook

  • Member
  • *
  • Posts: 71
    • D00k.net
Re: Wrapping a long title
« Reply #5 on: April 28, 2025, 06:17:56 AM »
Quote from: chronicallyoffline on April 27, 2025, 12:56:29 PM
Quote from: iPodVT on April 23, 2025, 12:13:31 PM
Quote from: mango on April 23, 2025, 03:42:35 AM
With a monospaced font I could calculate the number of characters on a line...

How would you do that?
From the CustomWPS page
 
%?if(%ss(0, 20, %it), =, %it)<track title length is 20 characters or less|track title length is over 20 characters>

I've attempted it, but the issue is there's no way to guarantee a break on a space unless there's some additional conditional wizardry we can do.

I've made a way recently to achieve this, but it's not foolproof since it relies on Bilgus' new file reading tag. There's no way within the theme spec to obtain a whitespace character for comparisons to make a conditional algorithm for breaking on space.
Logged

Offline iPodVT

  • Member
  • *
  • Posts: 480
Re: Wrapping a long title
« Reply #6 on: April 28, 2025, 08:30:37 AM »
Quote from: chronicallyoffline on April 27, 2025, 12:56:29 PM
From the CustomWPS page
 
%?if(%ss(0, 20, %it), =, %it)<track title length is 20 characters or less|track title length is over 20 characters>

I've attempted it, but the issue is there's no way to guarantee a break on a space unless there's some additional conditional wizardry we can do.

Thanks.  So you are hardcoding a specific mono spaced font which allows you to pre know exactly how many chars you can fit in the horizontal space?
Logged

Offline iPodVT

  • Member
  • *
  • Posts: 480
Re: Wrapping a long title
« Reply #7 on: April 28, 2025, 08:40:22 AM »
Quote from: Dook on April 28, 2025, 06:17:56 AM
I've made a way recently to achieve this, but it's not foolproof since it relies on Bilgus' new file reading tag. There's no way within the theme spec to obtain a whitespace character for comparisons to make a conditional algorithm for breaking on space.

Thanks.  And what if the second line of text doesn't fit within the horizontal space - does it scroll or wrap again or just get clipped/truncated?  The Title, Artist, Album, etc ID3 tags for Classical Music can sometimes be extremely verbose.

Do you ever notice any processing time lags in your WPS?

I will have to try out these various themes and also look at their code.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Wrapping a long title
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.064 seconds with 16 queries.