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
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
| | |-+  Possible to auto-size viewports for translated words?
« previous next »
  • Print
Pages: [1]

Author Topic: Possible to auto-size viewports for translated words?  (Read 2268 times)

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Possible to auto-size viewports for translated words?
« on: March 26, 2010, 01:49:49 PM »
I'm updating some of my themes to be able to use Text Translation %Sx tags. I have a "Next:" in a viewport, then the track text scrolls after it in a seperate viewport. Like so:

Code: [Select]
#
%V|10|98|27|12|3|B8C8E1|-|
%ar%Sx|Next:|
%V|40|98|126|12|3|B8C8E1|-|
%s%?It<%It|%Sx|<No Info>|>
#

The problem is, the "Next:" is in a static box size and foreign words have more characters and so get clipped.

Is there a way to have viewports auto size to word length? Scrolling it is not really an option as it'll look ugly. It would have to shunt the next viewports left side along too I suppose.
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Possible to auto-size viewports for translated words?
« Reply #1 on: March 26, 2010, 03:44:36 PM »
The best you could do, I imagine, is to use two lines rather than one so that space is only limited by the screen or maximum space.
Logged

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Re: Possible to auto-size viewports for translated words?
« Reply #2 on: March 26, 2010, 04:06:02 PM »
Quote
...use two lines rather than one...
Sadly, thats not an option as theres no extra space.

I think I might have to turn the word "Next" into an icon, perhaps like the skip track icon on a cd player.
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: Possible to auto-size viewports for translated words?
« Reply #3 on: March 27, 2010, 05:27:41 AM »
depends on how much this is wanted I might have a play. viewports need to be statically sized which limits it a bit, but I might be open to putting *in the viewport definition* the %Sx tag or plain text to size it correctly for the font. No rpomises of course
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Re: Possible to auto-size viewports for translated words?
« Reply #4 on: March 28, 2010, 08:02:41 AM »
Quote
No rpomises of course
No pressure  ;D

I think a resize option definately makes sense with text to be translated.
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Possible to auto-size viewports for translated words?
« Reply #5 on: March 28, 2010, 10:01:00 AM »
This would basically require viewports to be able to be positioned relative to other viewport boundaries rather than absolutely.

If one viewport got three characters wider, it would have to affect all other viewports it might now overlap unless you kept that space empty in advance (in which case there would've been no real reason not to have it wider in the first place).

Honestly, it's never going to look good in all languages - if you set it to expand or contract relative to the language some languages will always have weird effects.

My suggestion would be to just accept that it can't be perfect everywhere, and pick a few languages to test it in, and try to tune it manually to work for those languages, rather than hoping for an automatic solution that's likely to fail anyway.
Logged

Offline Multiplex

  • Member
  • *
  • Posts: 440
Re: Possible to auto-size viewports for translated words?
« Reply #6 on: March 28, 2010, 11:27:41 AM »
Thinking about this is a different way...

Maybe there could be some syntax for marking the fixed portion and scrolling portion of a line?

Perhaps putting the %s at the first position that is to scroll so you would have something like;

%ar%Sx|Next:|%s%?It<%It|%Sx|<No Info>|>

Just a thought - I have no idea how practical it is.
 
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Possible to auto-size viewports for translated words?
« Reply #7 on: March 28, 2010, 12:09:12 PM »
I don't know either, but it seems a much simpler to use and predict (from the WPS author's standpoint) solution to the problem.
Logged

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Re: Possible to auto-size viewports for translated words?
« Reply #8 on: March 28, 2010, 03:02:18 PM »
Quote
Perhaps putting the %s at the first position that is to scroll so you would have something like;

%ar%Sx|Next:|%s%?It<%It|%Sx|<No Info>|>

I already tried that. It scrolls the whole line unfortunately.
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline pixelma

  • Rockbox Expert
  • Member
  • *
  • Posts: 645
Re: Possible to auto-size viewports for translated words?
« Reply #9 on: March 28, 2010, 04:31:45 PM »
Yes, currently %s will scroll the whole line, no matter at which position it is.

I think Multiplex wanted to suggest this as a feature which could possibly be more simple to implement than dynamically resizing of viewports. Additionally there once was a patch by lowlight if I remember correctly which exactly did this and I saw it working fairly well  on my Ondio. This was way before viewports and even before scrolling margins (in the SVN version).

Found in the patch tracker: FS#5907
Logged

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Re: Possible to auto-size viewports for translated words?
« Reply #10 on: March 28, 2010, 05:33:20 PM »
Quote
I think Multiplex wanted to suggest this as a feature...

Oh I see. My bad. And yes that does seem a simpler fix rather than faffing with viewport sizing.
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline Multiplex

  • Member
  • *
  • Posts: 440
Re: Possible to auto-size viewports for translated words?
« Reply #11 on: April 01, 2010, 07:38:17 AM »
Quote from: pixelma on March 28, 2010, 04:31:45 PM
Found in the patch tracker: FS#5907
Oops - I thought it was just an idea, not a poorly remembered thing that someone else had already tried...

I know the WPS code has changed a lot over the years (Text only when I first found Rockbox) maybe I'll see if I can work out a new patch - the forecast for the Easter weekend is pretty poor so I may have some time to kill :-)
Logged

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Re: Possible to auto-size viewports for translated words?
« Reply #12 on: April 01, 2010, 08:16:05 AM »
Quote
...maybe I'll see if I can work out a new patch - the forecast for the Easter weekend is pretty poor so I may have some time to kill

Cool  ;D
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline Multiplex

  • Member
  • *
  • Posts: 440
Re: Possible to auto-size viewports for translated words?
« Reply #13 on: April 02, 2010, 02:46:59 PM »
Quote from: Multiplex on April 01, 2010, 07:38:17 AM
I know the WPS code has changed a lot over the years
That may have been the understatement of the century!

I may not manage to do the patch but I'm determined to see how this wonderful thing that is the new WPS engine works...
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Possible to auto-size viewports for translated words?
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.096 seconds with 15 queries.