Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
joetesta
Level 10

Text Size Calculation issue FHD some models

Hello -
I'm seeing an issue and hoping for some help or guidance for handling it.
The problem can be observed on Roku 3 (and at least one model of Roku TV, probably many other older models)
Get the LabelExample.zip from the tutorial docs here
To fully demonstrate the problem, I changed the contents of labelscene.xml to this:
<?xml version = "1.0" encoding = "utf-8" ?>

<!--********** Copyright 2016 Roku Corp.  All Rights Reserved. **********-->

<component name = "LabelExample" extends = "Scene" >

  <script type = "text/brightscript" >

    <![CDATA[

    sub init()
      m.top.backgroundURI = "pkg:/images/rsgde_bg_hd.jpg"

      example = m.top.findNode("exampleLabel")
      leftBorder = m.top.findNode("leftBorder")
      rightBorder = m.top.findNode("rightBorder")

      examplerect = example.boundingRect()
      centerx = (1280 - examplerect.width) / 2
      centery = (720 - examplerect.height) / 2
      example.translation = [ centerx, centery ]

      ? " XXXXXXXXXXXXXXXXXXXXXXXXX examplerect.width: "; examplerect.width

      borderY = centery + leftBorder.height/2
      leftBorder.translation = [centerx-leftBorder.width, borderY]
      rightBorder.translation = [centerx+examplerect.width, borderY]

      m.top.setFocus(true)
    end sub

    ]]>

  </script>

  <children >

    <Label 
      id = "exampleLabel" 
      width = "0"
      height = "44" 
      font = "font:MediumBoldSystemFont" 
      text = "All the Best Videos ... All the Time! All the Best Videos" 
      horizAlign = "center" 
      vertAlign = "center" />

    <Rectangle
      id="leftBorder"
      width="20"
      height="20"
      color="0XFF00FFFF"/>

    <Rectangle
      id="rightBorder"
      width="20"
      height="20"
      color="0XFF00FFFF"/>

  </children>

</component>


Now with this change alone, everything is fine (the pink rectangles line up exactly on the text boundaries) because the default is to ui resolution of HD.  Next, modify the manifest's last line of text to this:
ui_resolutions=fhd


Note that the existing format in the manifest is incorrect and retaining the quotation marks makes it do NOTHING.

Now observe on the screen with Roku3 that the right border rectangle is overlapping the words. The calculated examplerect width is wrong for this device and screen resolution. I'm trying to do some precise layouts based on text widths and this is making it not possible.  with Roku Ultra, everything works perfectly.  This is a mystery I would love to solve soon!
thank you very much in advance,
Joe
aspiring
0 Kudos
5 Replies
destruk
Level 10

Re: Text Size Calculation issue FHD some models

What if you set 
ui_resolutions=hd,fhd
0 Kudos
joetesta
Level 10

Re: Text Size Calculation issue FHD some models

Thanks - in that case the output matches the same as just listing HD there.  I think changing this in the app I'm working on would require substantial changes as everything's developed in fhd up to this point.
aspiring
0 Kudos
Highlighted
destruk
Level 10

Re: Text Size Calculation issue FHD some models

Yeah, I noticed that a few months ago - it's the suggested fix that was given on the forum.  Probably FHD isn't ready for prime time yet, as it also introduces alignment issues with the default overlays of some components and scaling of other components across devices (ie the pause timeline bar background, the mini keyboard overlay sizing, etc).  If you set your channel for HD then it should scale up just fine but the reverse isn't true yet.
0 Kudos
destruk
Level 10

Re: Text Size Calculation issue FHD some models

Another humorous note - if you only specify "sd" in the manifest for ui_resolutions, then roku3 and roku4 will refuse to run the channel, when it would make more logical/practical sense for it to upscale from sd as needed for those.
0 Kudos
joetesta
Level 10

Re: Text Size Calculation issue FHD some models

Thanks for the explanation Destruk, good to know!
aspiring
0 Kudos