big fonts for CHDK - page 2 - General Discussion and Assistance - CHDK Forum

big fonts for CHDK

  • 41 Replies
  • 8061 Views
Re: big fonts for CHDK
« Reply #10 on: 31 / October / 2013, 16:30:07 »
Advertisements
... msl meant to put the function in gui_draw.c rather than luascript.c
That is correct. So we can use this function for other GUI applications. People ask me very often whether it is possible to represent CHDK OSD text elements greater?
Okay .. I'll hold out the hope that outslider meant the drawings.lua module.   :-[

Meanwhile, if I follow where msl is going with this,  would a single "OSD" font size setting be sufficient rather than seperate font sized per element ?  One of the problems there will be the q&d nature of both our hacks - the current steps between font sizes are pretty big.  But searching back through the forum, its been a common request for years now.

Also, I just rediscovered the Lua bit operations - my Lua script from earlier can use some cleanup.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: big fonts for CHDK
« Reply #11 on: 31 / October / 2013, 17:11:18 »
Okay .. I'll hold out the hope that outslider meant the drawings.lua module.   :-[

Yes, I did, but conversation led all of you to different approaches which are better - usage of built-in fonts, which is impossible from current lua itself. So, in any case - there's a need to add new lua funcs.
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline philmoz

  • *****
  • 3179
    • Photos
Re: big fonts for CHDK
« Reply #12 on: 01 / November / 2013, 04:46:40 »
Patch with core code in gui_draw.c

Renamed Lua function to 'draw_string_scaled' to be consistent with 'draw_string'; but open to suggestions on this.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: big fonts for CHDK
« Reply #13 on: 01 / November / 2013, 05:44:16 »
Hey, do we really need a new lua function draw_string_scaled?

Currently we have:

draw_string( x, y, t, clt, clb)

Can't we just change it into:

draw_string( x, y, t, clt, clb [, size])?

Default size would be like now, but user could change the last parameter to decrease/increase size.
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick


*

Offline philmoz

  • *****
  • 3179
    • Photos
Re: big fonts for CHDK
« Reply #14 on: 01 / November / 2013, 06:26:05 »
Hey, do we really need a new lua function draw_string_scaled?

Currently we have:

draw_string( x, y, t, clt, clb)

Can't we just change it into:

draw_string( x, y, t, clt, clb [, size])?

Default size would be like now, but user could change the last parameter to decrease/increase size.

Good point :)

New patch with optional parameters in 'draw_string' for scaling:
    draw_string( x, y, t, clt, clb [, xsize [, ysize]])

Also fixes off-by-one error in draw_char_scaled function which removes some flickering and improves performance.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

*

Offline msl

  • *****
  • 1271
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: big fonts for CHDK
« Reply #15 on: 01 / November / 2013, 07:40:47 »
Patch 4 works fine for me. Thanks for that.

msl
CHDK-DE:  CHDK-DE links

Re: big fonts for CHDK
« Reply #16 on: 01 / November / 2013, 11:47:22 »
Patch 4 works fine for me. Thanks for that.
Ditto.

I did have another thought.  If the scale parameter is 0,  then how about a 1/2 size font?  Thinking ahead, there are times when that would be useful with console debugging (assuming we take the next step and start allowing OSD stuff to use variable sized fonts ...).  Also, the screen gets pretty crowded when Misc Values and the State displays and Debug data display are all active.  Yes - hard on old eyes but with "cheater" it makes debugging somewhat easier.


Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3179
    • Photos
Re: big fonts for CHDK
« Reply #17 on: 01 / November / 2013, 14:12:48 »
Patch 4 works fine for me. Thanks for that.
Ditto.

I did have another thought.  If the scale parameter is 0,  then how about a 1/2 size font?  Thinking ahead, there are times when that would be useful with console debugging (assuming we take the next step and start allowing OSD stuff to use variable sized fonts ...).  Also, the screen gets pretty crowded when Misc Values and the State displays and Debug data display are all active.  Yes - hard on old eyes but with "cheater" it makes debugging somewhat easier.

On newer cameras the font is already scaled x2 horizontally because the actual physical bitmap is 720 pixels (on the really old cameras CHDK started on it was only 360).

So a half scale horizontally can be done (with a bit of work) without any loss of fidelity in the displayed characters.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)


*

Offline philmoz

  • *****
  • 3179
    • Photos
Re: big fonts for CHDK
« Reply #18 on: 05 / November / 2013, 02:17:41 »
I've added this in revision 3200 (trunk).

I'll look at the half scaling separately.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: big fonts for CHDK
« Reply #19 on: 06 / November / 2013, 00:16:32 »
So we can use this function for other GUI applications. People ask me very often whether it is possible to represent CHDK OSD text elements greater?
I've added this in revision 3200 (trunk).
So I did a bit of crash coding today when I should have been doing other stuff.  I made it possible to change the text size of the standard CHDK OSD icons.

I'm sure it can use improvement - even I can see a few weak points in the data organization  But its pretty cool to be here :



OSD text size selectable on a per icon basis.   You just use the existing OSD Layout Editor - in addition to the up,down,right,left icon position control,  you do a half-press to change the text size.  Currently lets you select four sizes before it rotates back to the default size.  In the editor, non-text icons ignore the half-press as (currently) does the OSD stuff with lots of text - state display, misc values and debug.  But the rest do!   Saving to config files is included - backward compatible etc.   (Hope I got that part right ..)

Edit : need to play with the colored icons .. seems like they could be scaled too! And if philmoz gets 1/2 size text working it will need a few mods - ones well worth doing!
« Last Edit: 06 / November / 2013, 00:59:06 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics