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:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Displaying lots of text in a plugin
« previous next »
  • Print
Pages: [1]

Author Topic: Displaying lots of text in a plugin  (Read 1217 times)

Offline mikeage

  • Member
  • *
  • Posts: 110
    • mikeage.net
Displaying lots of text in a plugin
« on: November 24, 2007, 11:57:59 PM »
I'm writing a plugin which will display a lot of text. My first idea was to write to a temporary file and launch the text viewer, which could handle the scrolling, but I understand that a plugin may not launch another plugin.

Currently, I'm using rb->splash on a short amount of text, and parsing left and right to display the next or previous screen, but in addition to being incredibly ugly (from a coding standpoint), I have no way to know how much text I can print to one screen (so I'm just snprintf'ing a fixed, relatively small amount at a time).

Can anyone suggest a better way?
Logged

Offline safetydan

  • Developer
  • Member
  • *
  • Posts: 248
Re: Displaying lots of text in a plugin
« Reply #1 on: November 25, 2007, 01:20:14 AM »
You can get the size of the current font from the the plugin API. Either rb->font_get_width or rb->font_getstringsize will let you figure out the size in pixels of the current font. Combine that with the screen dimensions and you should be able to figure out how much text you can print with lcd_puts.
Logged

Offline mikeage

  • Member
  • *
  • Posts: 110
    • mikeage.net
Re: Displaying lots of text in a plugin
« Reply #2 on: November 25, 2007, 02:11:03 AM »
thanks... I didn't know about those APIs!

I'll check it out...
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Displaying lots of text in a plugin
 

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

Page created in 0.053 seconds with 17 queries.