Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert from openGLCD #1263

Closed
crd5014 opened this issue Aug 24, 2020 · 10 comments
Closed

Convert from openGLCD #1263

crd5014 opened this issue Aug 24, 2020 · 10 comments
Milestone

Comments

@crd5014
Copy link

crd5014 commented Aug 24, 2020

I am converting a project from openGLCD to U8G2. Two questions:

  1. Is there a way to convert an openGLCD formatted custom font library to a font library compatible with U8G2? Maybe several steps, convert openGLCD (i.e. GLCDFONTDECL hex data) to BDF then to U8G2?
  2. Is there method or function similar to the openGLCD gText that allows you to define differently formatted text areas on a given GLCD screen and print to each like a terminal?

Thank you very much for any advice you can provide.

@olikraus
Copy link
Owner

olikraus commented Sep 1, 2020

Is there a way to convert an openGLCD formatted custom font library to a font library compatible with U8G2? Maybe several steps, convert openGLCD (i.e. GLCDFONTDECL hex data) to BDF then to U8G2?

No. Maybe the source of that font is available as ttf or bdf, then it could be converted.

Is there method or function similar to the openGLCD gText that allows you to define differently formatted text areas on a given GLCD screen and print to each like a terminal?

Not directly. There are some helper function like https://github.com/olikraus/u8g2/wiki/u8g2reference#setclipwindow

Due to the nature of u8g2 there is no bit blit (https://en.wikipedia.org/wiki/Bit_blit) which is there in GLCD to do the sub-window scrolling. Still such kind of effects are possible in u8g2 (see the scrolling examples) but they are based on redrawing and not on bit blit procedures like in GLCD. So as a result: There are no simple 1:1 commands available.

You may ask: Why is there such a difference? The answer is simple: U8g2 has been designed to work without reading back the memory buffer. In fact many some displays do not allow reading back the graphics display content, so such displays are supported by u8g2 which will be never supported by GLCD.

@crd5014
Copy link
Author

crd5014 commented Sep 1, 2020

OK, thanks for the insight.

@crd5014 crd5014 closed this as completed Sep 1, 2020
@dpwe
Copy link

dpwe commented Feb 21, 2022

I was able to convert some openGLCD fonts (the calfonts) to BDF, and then use them within u8g2.

See the IPython notebook here: https://github.com/dpwe/calfonts/blob/add-bd/glcd-fontcreator-to-bdf.ipynb

You should be able to use this for any of the openGLCD fonts.

@olikraus
Copy link
Owner

Thanks a lot. If the bdf's are available somewhere, then I also could add them to u8g2 permanently.

@olikraus
Copy link
Owner

I can also make a PR for u8g2 if that's easier.

there is a script which does most of the work, so I will do this, no problem.

@olikraus olikraus added this to the 2.32 milestone Feb 22, 2022
@dpwe
Copy link

dpwe commented Feb 22, 2022

Sounds great. It would be nice to preserve the copyright message from the calfonts files, viz:

Copyright (C) 2010 by Integrated Mapping Ltd

@olikraus
Copy link
Owner

Sure, indeed I will mention (as usual) the copyright:

 *
 * Copyright (C) 2010 by Integrated Mapping Ltd
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.

@dpwe
Copy link

dpwe commented Feb 22, 2022

Great! Thank you.

@olikraus olikraus reopened this Feb 22, 2022
@olikraus
Copy link
Owner

olikraus commented Feb 26, 2022

32-127 (MM_R)
fonts added to bdf folder

olikraus added a commit that referenced this issue Feb 26, 2022
olikraus added a commit that referenced this issue Feb 26, 2022
@olikraus olikraus closed this as completed Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants