text rendering

User avatar
Badger
Posts: 346
Joined: Mon Apr 18, 2011 6:07 pm

Re: text rendering

Post by Badger »

we can do those, although I'm not sure how \t will work with variable width characters? I suppose we just define the tab width in pixels.

What would vertical tab be used for? I'm sure it can be implemented, I've just not come across it before!
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: text rendering

Post by Tectu »

Yeah, we deffintly have to make a kind of a pixel oriented grid for tabs.
I guess it is no problem to implement \v if \t is working. It is the same, just in Y direction instead of X directions. Don't see any problem there.

It would be useful for tables. Some example:

Code: Select all

chprintf(&GLCDD1, "name: %d \t\t % bytes\r\n", file_name, file_size);



~ Tectu
Abhishek
Posts: 266
Joined: Wed May 23, 2012 3:15 pm

Re: text rendering

Post by Abhishek »

Tab support calls for monospaced fonts, I guess... ;) (Though we can do it with variable pitch also, yet to keep it simple)

I'll generate some monospaced fonts next week with the generator app and it to the repo anyway...

Abhishek
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: text rendering

Post by Tectu »

I still think that the best we can do is make it monospace "from default" and add variable length per #ifdef later on.
This dosen't affect performance and size when using monospace, but variable length fonts are still possible and easy to implement, I guess.



~ Tectu
User avatar
Badger
Posts: 346
Joined: Mon Apr 18, 2011 6:07 pm

Re: text rendering

Post by Badger »

I almost had text scrolling working then I discovered some severe limitations on the SSD1289:
  • you can only scroll in portrait mode
  • scrolling shifts the entire coordinate system of the screen
  • scrolling effects the entire screen, e.g you can't just scroll a small area

Maybe not all drivers have these limitations. To get around it, there are two options; either cache the text in memory, or read/write the display one row at a time to shift it. I prefer the second approach because it doesn't use lots of memory, but has the restriction that it can only work on drivers that can read the graphical RAM. Doing the transfers line by line isn't too inefficient, but its not as quick as the built in scroll. This can probably be done using DMA over FSMC, so we don't block the cpu too much.
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: text rendering

Post by Tectu »

Badger wrote:Maybe not all drivers have these limitations. To get around it, there are two options; either cache the text in memory, or read/write the display one row at a time to shift it. I prefer the second approach because it doesn't use lots of memory, but has the restriction that it can only work on drivers that can read the graphical RAM.

Not sure what you mean with that. I guess each driver needs to provide the lld_lcdReadXXX(); functions? And I guess you can read out the LCD's controller's RAM on every LCD controller. Where's the problem?

But in general I agree with you. Caching the whole thing would use to much memory for small MCUs.


~ Tectu
User avatar
Badger
Posts: 346
Joined: Mon Apr 18, 2011 6:07 pm

Re: text rendering

Post by Badger »

Tectu wrote:Not sure what you mean with that. I guess each driver needs to provide the lld_lcdReadXXX(); functions? And I guess you can read out the LCD's controller's RAM on every LCD controller. Where's the problem?

there probably isn't a problem, both of the drivers we use so far appear to support reading the ram. But there might be some out there that don't!

It looks like the S6D1121 is less limited in this area, as it appears to be able to scroll a defined area. Hopefully this will also apply to landscape mode. I don't have one to test, so the users of that driver (I'm looking at Abhishek!) will have to implement the scrolling lld code :D

I noticed an interesting feature of the SSD1289 recently, it effectively has two screens worth of memory. We could implement double buffering by writing to each screen before displaying it (it can be instantly displayed using the scroll feature). If there is an easy way to copy memory within the driver then we could quite easily enable flicker-less update of the screen. Anyway, that's an idea for the future :)
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: text rendering

Post by Tectu »

All of this sounds awesome, but we have the problem that we need to support the lowest-featured chip too.

The easiest way would be to do this with lld functions. I am still writing up some more wiki pages, which describe how to write a new driver etc.
Then, we just call the lld function in the highlevel files like glcd.c and console.c, and lower drivers like the SSD1289 will do it by reading and redrawing or even double buffering, while S61121 will do it with area scroll.

I guess this is the only good solution, but I am open minded, so go on.


~ Tectu
User avatar
Badger
Posts: 346
Joined: Mon Apr 18, 2011 6:07 pm

Re: text rendering

Post by Badger »

All of this sounds awesome, but we have the problem that we need to support the lowest-featured chip too.

That is true, but we have to draw the line somewhere or we severely limit the library. I think at a minimum we have to require read/write of graphical RAM as it will allow us to have a much more simple code base that doesn't use loads of memory to buffer graphical data.

Tectu wrote:The easiest way would be to do this with lld functions. I am still writing up some more wiki pages, which describe how to write a new driver etc.
Then, we just call the lld function in the highlevel files like glcd.c and console.c, and lower drivers like the SSD1289 will do it by reading and redrawing or even double buffering, while S61121 will do it with area scroll.

that is my plan, and I have already made progress on this (see my fork).

I've just ordered an S6D1121 module, so I look forward to seeing what fancy stuff can be done with that driver, as it looks like it has more features than the SSD1289.
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: text rendering

Post by Tectu »

Badger wrote:I've just ordered an S6D1121 module, so I look forward to seeing what fancy stuff can be done with that driver, as it looks like it has more features than the SSD1289.

I've just ordered the same disply a few minutes ago. But it takes about 15 days to recive it (at least the other display). I hope that I can test more stuff then too and push things straight forward.

Anyways, I am very interested in your work. Can you say when I'll receive a finished pull request of yours? :)


~ Tectu
Locked