Kerning and other glyph placement issues

I’m using SDL_ttf, but having some rather poor results:

http://cl.ly/image/3X350h1p3I2x/Screen%20Shot%202014-07-01%20at%202.23.30%20.png

Each of those fields is rendered as one surface, with this code:

SDL_Surface* sdlS = ::TTF_RenderUTF8_Blended(mFont, mText.c_str(), mTextColor);
int result = ::SDL_BlitSurface(sdlS, NULL, mDisplay, &destRect);

Notice how the bases of each glyph jitter, as well as the size of glyphs relative to adjacent characters (e.g. “Sun”)? Notice how the 6 and 9 have fattened vertical sections?

I’m using a Helvetica Neue I found online, but it renders perfectly in OS X’s quicklook:

http://cl.ly/image/3Z0j2T3z0u36/Screen%20Shot%202014-07-01%20at%202.28.13%20.png

Any suggestions?

Thanks!–
Rick

Hi,

Strange, could this be :

  • your “destRect” which is small and induces (bad) rescaling
  • your freetype lib (old?)
  • a bug in sdl_ttf, try the latest version of trunk.
  • give a try with different fonts.

Provide me the ttf font file, so I can have a look.

Cheers,
SylvainOn Tue, Jul 1, 2014 at 11:28 AM, Rick Mann wrote:

I’m using SDL_ttf, but having some rather poor results:

    http://cl.ly/image/3X350h1p3I2x/Screen%20Shot%202014-07-01%20at%202.23.30%20.png

Each of those fields is rendered as one surface, with this code:

SDL_Surface* sdlS = ::TTF_RenderUTF8_Blended(mFont, mText.c_str(), mTextColor);
int result = ::SDL_BlitSurface(sdlS, NULL, mDisplay, &destRect);

Notice how the bases of each glyph jitter, as well as the size of glyphs relative to adjacent characters (e.g. “Sun”)? Notice how the 6 and 9 have fattened vertical sections?

I’m using a Helvetica Neue I found online, but it renders perfectly in OS X’s quicklook:

    http://cl.ly/image/3Z0j2T3z0u36/Screen%20Shot%202014-07-01%20at%202.28.13%20.png

Any suggestions?

Thanks!


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker

  • your “destRect” which is small and induces (bad) rescaling

I understood that it ignores the width and height, and only uses the origin. From the docs here:

https://wiki.libsdl.org/SDL_BlitSurface?highlight=%28%5CbCategoryAPI%5Cb%29%7C%28SDLFunctionTemplate%29

"Only the position is used in the dstrect (the width and height are ignored)."
  • your freetype lib (old?)

Possibly. I just found it online somewhere. Here it is:

http://cl.ly/1A3B2f2W2W3H/HelveticaNeue-Regular.ttf
  • a bug in sdl_ttf, try the latest version of trunk.

I’m using the following OS X frameworks:

#define SDL_TTF_MAJOR_VERSION 2
#define SDL_TTF_MINOR_VERSION 0
#define SDL_TTF_PATCHLEVEL 11

#define SDL_MAJOR_VERSION 1
#define SDL_MINOR_VERSION 2
#define SDL_PATCHLEVEL 15

Unfortunately, I have to use SDL 1.2 because the target hardware, a BeagleBone Black, isn’t supported by SDL 2.0.

  • give a try with different fonts.

I’ll try to find another.

Provide me the ttf font file, so I can have a look.

http://cl.ly/1A3B2f2W2W3H/HelveticaNeue-Regular.ttf

Thanks!On Jul 2, 2014, at 11:23 , Sylvain Becker <sylvain.becker at gmail.com> wrote:


Rick

  • give a try with different fonts.

I tried it with an OTF version of the font, and while the glyph positioning is different, it’s still all over the map.On Jul 2, 2014, at 11:23 , Sylvain Becker <sylvain.becker at gmail.com> wrote:


Rick

I mixed SDL_BlitSurface and SDL_RenderCopy, the DstRect is indeed used
for positionning only.

Your font, with SDL2, looks correct to me …

Also, you can try with TTF_RenderUTF8_Shaded, instead of TTF_RenderUTF8_Blender

I am almost sure that you can use the SDL2_ttf2 with SDL-1.2
Give a try only replacing SDL_ttf.cOn Wed, Jul 2, 2014 at 10:54 PM, Rick Mann wrote:

On Jul 2, 2014, at 11:23 , Sylvain Becker <@Sylvain_Becker> wrote:

  • give a try with different fonts.

I tried it with an OTF version of the font, and while the glyph positioning is different, it’s still all over the map.


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker

I mixed SDL_BlitSurface and SDL_RenderCopy, the DstRect is indeed used
for positionning only.

Your font, with SDL2, looks correct to me …

Also, you can try with TTF_RenderUTF8_Shaded, instead of TTF_RenderUTF8_Blender

I did try those before. It had the same effect (except that it fills the background as well).

I am almost sure that you can use the SDL2_ttf2 with SDL-1.2
Give a try only replacing SDL_ttf.c

Yes, I’ve been using it without problems this whole time. I didn’t replace any files, though, it just seemed to work (except for this glyph issue).

I’m happy to give you the whole source to try. It runs on OS X (it’s an Xcode project), but the Makefile builds for Debian on BeagleBone Black, shouldn’t be too hard to get it to build for whatever Linux you want, assuming SDL 1.2.

I haven’t built for Debian in a while, though. I’ll have to try that tonight at home. I also want to try that to see if it has the same results.

Is there a way to generate PNG files from my display surface (for screenshots)?On Jul 2, 2014, at 14:09 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

On Wed, Jul 2, 2014 at 10:54 PM, Rick Mann <@Rick_Mann> wrote:

On Jul 2, 2014, at 11:23 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

  • give a try with different fonts.

I tried it with an OTF version of the font, and while the glyph positioning is different, it’s still all over the map.


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick

I tried it on the BeagleBone Black/Debian, I get the exact same results. I’m not very well versed with git, but I’ve put my code up there:

https://github.com/JetForMe/SPSDisplayOn Jul 2, 2014, at 14:09 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

I mixed SDL_BlitSurface and SDL_RenderCopy, the DstRect is indeed used
for positionning only.

Your font, with SDL2, looks correct to me …

Also, you can try with TTF_RenderUTF8_Shaded, instead of TTF_RenderUTF8_Blender

I am almost sure that you can use the SDL2_ttf2 with SDL-1.2
Give a try only replacing SDL_ttf.c

On Wed, Jul 2, 2014 at 10:54 PM, Rick Mann <@Rick_Mann> wrote:

On Jul 2, 2014, at 11:23 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

  • give a try with different fonts.

I tried it with an OTF version of the font, and while the glyph positioning is different, it’s still all over the map.


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick

Make sure you are using the latest version of the file “SDL_ttf.c” for
the SDL_ttf mercurial trunk ! (I mean not only the SDL2 version)

Which size are you using for the font ?

I won’t be able to run your code as I dont use sdl-1.2 anymore, and
dont want to port the whole app.
Please, write a minimal test case if you want me to run it !
Then, I will try it tomorrow.

To answer your question : if I remember correctly, you can save
surface to image with SDL_SaveBmp

Cheers,
SylvainOn Thu, Jul 3, 2014 at 9:09 AM, Rick Mann wrote:

I tried it on the BeagleBone Black/Debian, I get the exact same results. I’m not very well versed with git, but I’ve put my code up there:

    https://github.com/JetForMe/SPSDisplay

On Jul 2, 2014, at 14:09 , Sylvain Becker <@Sylvain_Becker> wrote:

I mixed SDL_BlitSurface and SDL_RenderCopy, the DstRect is indeed used
for positionning only.

Your font, with SDL2, looks correct to me …

Also, you can try with TTF_RenderUTF8_Shaded, instead of TTF_RenderUTF8_Blender

I am almost sure that you can use the SDL2_ttf2 with SDL-1.2
Give a try only replacing SDL_ttf.c

On Wed, Jul 2, 2014 at 10:54 PM, Rick Mann wrote:

On Jul 2, 2014, at 11:23 , Sylvain Becker <@Sylvain_Becker> wrote:

  • give a try with different fonts.

I tried it with an OTF version of the font, and while the glyph positioning is different, it’s still all over the map.


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker

Hmm. I’m using the Framework. I’d have to get the whole thing and build it.On Jul 3, 2014, at 00:39 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

Make sure you are using the latest version of the file “SDL_ttf.c” for
the SDL_ttf mercurial trunk ! (I mean not only the SDL2 version)

Which size are you using for the font ?

I won’t be able to run your code as I dont use sdl-1.2 anymore, and
dont want to port the whole app.
Please, write a minimal test case if you want me to run it !
Then, I will try it tomorrow.

To answer your question : if I remember correctly, you can save
surface to image with SDL_SaveBmp

Cheers,
Sylvain

On Thu, Jul 3, 2014 at 9:09 AM, Rick Mann <@Rick_Mann> wrote:

I tried it on the BeagleBone Black/Debian, I get the exact same results. I’m not very well versed with git, but I’ve put my code up there:

   https://github.com/JetForMe/SPSDisplay

On Jul 2, 2014, at 14:09 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

I mixed SDL_BlitSurface and SDL_RenderCopy, the DstRect is indeed used
for positionning only.

Your font, with SDL2, looks correct to me …

Also, you can try with TTF_RenderUTF8_Shaded, instead of TTF_RenderUTF8_Blender

I am almost sure that you can use the SDL2_ttf2 with SDL-1.2
Give a try only replacing SDL_ttf.c

On Wed, Jul 2, 2014 at 10:54 PM, Rick Mann <@Rick_Mann> wrote:

On Jul 2, 2014, at 11:23 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

  • give a try with different fonts.

I tried it with an OTF version of the font, and while the glyph positioning is different, it’s still all over the map.


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick

Yeah, I can’t figure out how to build the frameworks. They don’t just build out of the box.On Jul 3, 2014, at 00:39 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

Make sure you are using the latest version of the file “SDL_ttf.c” for
the SDL_ttf mercurial trunk ! (I mean not only the SDL2 version)

Which size are you using for the font ?

I won’t be able to run your code as I dont use sdl-1.2 anymore, and
dont want to port the whole app.
Please, write a minimal test case if you want me to run it !
Then, I will try it tomorrow.

To answer your question : if I remember correctly, you can save
surface to image with SDL_SaveBmp

Cheers,
Sylvain

On Thu, Jul 3, 2014 at 9:09 AM, Rick Mann <@Rick_Mann> wrote:

I tried it on the BeagleBone Black/Debian, I get the exact same results. I’m not very well versed with git, but I’ve put my code up there:

   https://github.com/JetForMe/SPSDisplay

On Jul 2, 2014, at 14:09 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

I mixed SDL_BlitSurface and SDL_RenderCopy, the DstRect is indeed used
for positionning only.

Your font, with SDL2, looks correct to me …

Also, you can try with TTF_RenderUTF8_Shaded, instead of TTF_RenderUTF8_Blender

I am almost sure that you can use the SDL2_ttf2 with SDL-1.2
Give a try only replacing SDL_ttf.c

On Wed, Jul 2, 2014 at 10:54 PM, Rick Mann <@Rick_Mann> wrote:

On Jul 2, 2014, at 11:23 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

  • give a try with different fonts.

I tried it with an OTF version of the font, and while the glyph positioning is different, it’s still all over the map.


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick

SDL and SDL2 doesn’t really take very long to build.

I got it to build and run on Kubuntu 14.04 but all I got was a black screen
and it jacked my resolution to 640x480. I’m not very fluent with OSX as I
am Linux.On Thu, Jul 3, 2014 at 3:45 AM, Rick Mann wrote:

Hmm. I’m using the Framework. I’d have to get the whole thing and build it.

On Jul 3, 2014, at 00:39 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

Make sure you are using the latest version of the file “SDL_ttf.c” for
the SDL_ttf mercurial trunk ! (I mean not only the SDL2 version)

Which size are you using for the font ?

I won’t be able to run your code as I dont use sdl-1.2 anymore, and
dont want to port the whole app.
Please, write a minimal test case if you want me to run it !
Then, I will try it tomorrow.

To answer your question : if I remember correctly, you can save
surface to image with SDL_SaveBmp

Cheers,
Sylvain

On Thu, Jul 3, 2014 at 9:09 AM, Rick Mann wrote:

I tried it on the BeagleBone Black/Debian, I get the exact same
results. I’m not very well versed with git, but I’ve put my code up there:

   https://github.com/JetForMe/SPSDisplay

On Jul 2, 2014, at 14:09 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

I mixed SDL_BlitSurface and SDL_RenderCopy, the DstRect is indeed used
for positionning only.

Your font, with SDL2, looks correct to me …

Also, you can try with TTF_RenderUTF8_Shaded, instead of
TTF_RenderUTF8_Blender

I am almost sure that you can use the SDL2_ttf2 with SDL-1.2
Give a try only replacing SDL_ttf.c

On Wed, Jul 2, 2014 at 10:54 PM, Rick Mann wrote:

On Jul 2, 2014, at 11:23 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

  • give a try with different fonts.

I tried it with an OTF version of the font, and while the glyph
positioning is different, it’s still all over the map.


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Maybe not, unless they don’t build cleanly. Also, I’m trying to build the Xcode Framework, not the regular lib.

Sylvain, here’s a small sample:

https://pastee.org/wda6

It produces this:

http://cl.ly/image/1N1h232k0B1g/Screen%20Shot%202014-07-03%20at%202.56.49%20.png

This is with the 2.0.11 SDL 1.2 Framework.On Jul 3, 2014, at 02:03 , Jonathan Greig wrote:

SDL and SDL2 doesn’t really take very long to build.

I got it to build and run on Kubuntu 14.04 but all I got was a black screen and it jacked my resolution to 640x480. I’m not very fluent with OSX as I am Linux.

On Thu, Jul 3, 2014 at 3:45 AM, Rick Mann <@Rick_Mann> wrote:
Hmm. I’m using the Framework. I’d have to get the whole thing and build it.

On Jul 3, 2014, at 00:39 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

Make sure you are using the latest version of the file “SDL_ttf.c” for
the SDL_ttf mercurial trunk ! (I mean not only the SDL2 version)

Which size are you using for the font ?

I won’t be able to run your code as I dont use sdl-1.2 anymore, and
dont want to port the whole app.
Please, write a minimal test case if you want me to run it !
Then, I will try it tomorrow.

To answer your question : if I remember correctly, you can save
surface to image with SDL_SaveBmp

Cheers,
Sylvain

On Thu, Jul 3, 2014 at 9:09 AM, Rick Mann <@Rick_Mann> wrote:

I tried it on the BeagleBone Black/Debian, I get the exact same results. I’m not very well versed with git, but I’ve put my code up there:

   https://github.com/JetForMe/SPSDisplay

On Jul 2, 2014, at 14:09 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

I mixed SDL_BlitSurface and SDL_RenderCopy, the DstRect is indeed used
for positionning only.

Your font, with SDL2, looks correct to me …

Also, you can try with TTF_RenderUTF8_Shaded, instead of TTF_RenderUTF8_Blender

I am almost sure that you can use the SDL2_ttf2 with SDL-1.2
Give a try only replacing SDL_ttf.c

On Wed, Jul 2, 2014 at 10:54 PM, Rick Mann <@Rick_Mann> wrote:

On Jul 2, 2014, at 11:23 , Sylvain Becker <sylvain.becker at gmail.com> wrote:

  • give a try with different fonts.

I tried it with an OTF version of the font, and while the glyph positioning is different, it’s still all over the map.


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick

No it wasn’t cleanly, but here is the compile log. Not many issues, but a
few:

jpg at trusty-laptop:~/Desktop/sdlq/SPSDisplay/SPSDisplay/trunk$ make
gcc -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT spa.c -o spa.o
gcc -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT spa.c > spa.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLDisplay.cpp -o SDL/SDLDisplay.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLDisplay.cpp > SDL/SDLDisplay.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLFont.cpp -o SDL/SDLFont.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLFont.cpp > SDL/SDLFont.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLLabel.cpp -o SDL/SDLLabel.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLLabel.cpp > SDL/SDLLabel.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLSurface.cpp -o SDL/SDLSurface.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLSurface.cpp > SDL/SDLSurface.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLView.cpp -o SDL/SDLView.o
In file included from SDL/SDLView.cpp:9:0:
SDL/SDLView.h: In constructor ?SDLView::SDLView(const SDL_Rect&)?:
SDL/SDLView.h:57:15: warning: ?SDLView::mBackgroundColor? will be
initialized after [-Wreorder]
  SDL_Color    mBackgroundColor;
               ^
SDL/SDLView.h:55:11: warning:   ?bool SDLView::mNeedsDisplay? [-Wreorder]
  bool     mNeedsDisplay;
           ^
SDL/SDLView.cpp:24:1: warning:   when initialized here [-Wreorder]
 SDLView::SDLView(const SDL_Rect& inFrame)
 ^
In file included from SDL/SDLView.cpp:9:0:
SDL/SDLView.h: In constructor ?SDLView::SDLView(int16_t, int16_t, uint16_t,
uint16_t)?:
SDL/SDLView.h:57:15: warning: ?SDLView::mBackgroundColor? will be
initialized after [-Wreorder]
  SDL_Color    mBackgroundColor;
               ^
SDL/SDLView.h:55:11: warning:   ?bool SDLView::mNeedsDisplay? [-Wreorder]
  bool     mNeedsDisplay;
           ^
SDL/SDLView.cpp:32:1: warning:   when initialized here [-Wreorder]
 SDLView::SDLView(int16_t inX, int16_t inY, uint16_t inWidth, uint16_t
inHeight)
 ^
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLView.cpp > SDL/SDLView.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
BBBDisplayApp.cpp -o BBBDisplayApp.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
BBBDisplayApp.cpp > BBBDisplayApp.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
ChargeController.cpp -o ChargeController.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
ChargeController.cpp > ChargeController.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SPSDisplayApp.cpp -o SPSDisplayApp.o
SPSDisplayApp.cpp: In member function ?virtual bool SPSDisplayApp::init()?:

SPSDisplayApp.cpp:85:11: warning: unused variable ?labelFontBold?
[-Wunused-variable]
  SDLFont* labelFontBold = SDLFont::fontForName("HelveticaNeue-Bold.ttf",
12);
           ^

g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SPSDisplayApp.cpp > SPSDisplayApp.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
TristarMPPT.cpp -o TristarMPPT.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
TristarMPPT.cpp > TristarMPPT.d
g++ spa.o SDL/SDLDisplay.o SDL/SDLFont.o SDL/SDLLabel.o SDL/SDLSurface.o
SDL/SDLView.o BBBDisplayApp.o ChargeController.o SPSDisplayApp.o
TristarMPPT.o -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lSDL_ttf
-lmodbus -lpthread -o app
jpg at trusty-laptop:~/Desktop/sdlq/SPSDisplay/SPSDisplay/trunk$
```On Thu, Jul 3, 2014 at 4:59 AM, Rick Mann <rmann at latencyzero.com> wrote:

> Maybe not, unless they don't build cleanly. Also, I'm trying to build the
> Xcode Framework, not the regular lib.
>
> Sylvain, here's a small sample:
>
>         https://pastee.org/wda6
>
> It produces this:
>
>
> http://cl.ly/image/1N1h232k0B1g/Screen%20Shot%202014-07-03%20at%202.56.49%20.png
>
> This is with the 2.0.11 SDL 1.2 Framework.
>
>
> On Jul 3, 2014, at 02:03 , Jonathan Greig <@Jonathan_Greig> wrote:
>
> > SDL and SDL2 doesn't really take very long to build.
> >
> > I got it to build and run on Kubuntu 14.04 but all I got was a black
> screen and it jacked my resolution to 640x480. I'm not very fluent with OSX
> as I am Linux.
> >
> >
> > On Thu, Jul 3, 2014 at 3:45 AM, Rick Mann <rmann at latencyzero.com> wrote:
> > Hmm. I'm using the Framework. I'd have to get the whole thing and build
> it.
> >
> > On Jul 3, 2014, at 00:39 , Sylvain Becker <sylvain.becker at gmail.com> wrote:
> >
> > > Make sure you are using the latest version of the file "SDL_ttf.c" for
> > > the SDL_ttf mercurial trunk ! (I mean not only the SDL2 version)
> > >
> > > Which size are you using for the font ?
> > >
> > > I won't be able to run your code as I dont use sdl-1.2 anymore, and
> > > dont want to port the whole app.
> > > Please, write a minimal test case if you want me to run it !
> > > Then, I will try it tomorrow.
> > >
> > > To answer your question : if I remember correctly, you can save
> > > surface to image with SDL_SaveBmp
> > >
> > > Cheers,
> > > Sylvain
> > >
> > >
> > >
> > >
> > > On Thu, Jul 3, 2014 at 9:09 AM, Rick Mann <rmann at latencyzero.com> wrote:
> > >> I tried it on the BeagleBone Black/Debian, I get the exact same
> results. I'm not very well versed with git, but I've put my code up there:
> > >>
> > >>        https://github.com/JetForMe/SPSDisplay
> > >>
> > >>
> > >> On Jul 2, 2014, at 14:09 , Sylvain Becker <sylvain.becker at gmail.com> wrote:
> > >>
> > >>> I mixed SDL_BlitSurface and SDL_RenderCopy, the DstRect is indeed
> used
> > >>> for positionning only.
> > >>>
> > >>>
> > >>> Your font, with SDL2, looks correct to me ...
> > >>>
> > >>> Also, you can try with TTF_RenderUTF8_Shaded, instead of
> TTF_RenderUTF8_Blender
> > >>>
> > >>> I am almost sure that you can use the SDL2_ttf2 with SDL-1.2
> > >>> Give a try only replacing SDL_ttf.c
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> On Wed, Jul 2, 2014 at 10:54 PM, Rick Mann <rmann at latencyzero.com> wrote:
> > >>>>
> > >>>> On Jul 2, 2014, at 11:23 , Sylvain Becker <sylvain.becker at gmail.com> wrote:
> > >>>>
> > >>>>> - give a try with different fonts.
> > >>>>
> > >>>> I tried it with an OTF version of the font, and while the glyph
> positioning is different, it's still all over the map.
> > >>>>
> > >>>> --
> > >>>> Rick
> > >>>>
> > >>>>
> > >>>>
> > >>>> _______________________________________________
> > >>>> SDL mailing list
> > >>>> SDL at lists.libsdl.org
> > >>>> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> Sylvain Becker
> > >>> _______________________________________________
> > >>> SDL mailing list
> > >>> SDL at lists.libsdl.org
> > >>> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> > >>
> > >>
> > >> --
> > >> Rick
> > >>
> > >>
> > >>
> > >> _______________________________________________
> > >> SDL mailing list
> > >> SDL at lists.libsdl.org
> > >> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> > >
> > >
> > >
> > > --
> > > Sylvain Becker
> > > _______________________________________________
> > > SDL mailing list
> > > SDL at lists.libsdl.org
> > > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >
> >
> > --
> > Rick
> >
> >
> >
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>
> --
> Rick
>
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>

Rick,

I tried with the latest version and I have the same rendering issue !
I opened a bug for that :

Maybe add yourself to the CC list to know about it …
In the mean time use another font :slight_smile: or try fixing is with SDL2 environment .

Cheers,

SylvainOn Thu, Jul 3, 2014 at 12:09 PM, Jonathan Greig wrote:

No it wasn’t cleanly, but here is the compile log. Not many issues, but a
few:

jpg at trusty-laptop:~/Desktop/sdlq/SPSDisplay/SPSDisplay/trunk$ make
gcc -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT spa.c -o spa.o
gcc -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT spa.c > spa.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLDisplay.cpp -o SDL/SDLDisplay.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLDisplay.cpp > SDL/SDLDisplay.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLFont.cpp -o SDL/SDLFont.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLFont.cpp > SDL/SDLFont.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLLabel.cpp -o SDL/SDLLabel.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLLabel.cpp > SDL/SDLLabel.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLSurface.cpp -o SDL/SDLSurface.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLSurface.cpp > SDL/SDLSurface.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLView.cpp -o SDL/SDLView.o
In file included from SDL/SDLView.cpp:9:0:
SDL/SDLView.h: In constructor ?SDLView::SDLView(const SDL_Rect&)?:
SDL/SDLView.h:57:15: warning: ?SDLView::mBackgroundColor? will be
initialized after [-Wreorder]
  SDL_Color    mBackgroundColor;
               ^
SDL/SDLView.h:55:11: warning:   ?bool SDLView::mNeedsDisplay? [-Wreorder]
  bool     mNeedsDisplay;
           ^
SDL/SDLView.cpp:24:1: warning:   when initialized here [-Wreorder]
 SDLView::SDLView(const SDL_Rect& inFrame)
 ^
In file included from SDL/SDLView.cpp:9:0:
SDL/SDLView.h: In constructor ?SDLView::SDLView(int16_t, int16_t, uint16_t,
uint16_t)?:
SDL/SDLView.h:57:15: warning: ?SDLView::mBackgroundColor? will be
initialized after [-Wreorder]
  SDL_Color    mBackgroundColor;
               ^
SDL/SDLView.h:55:11: warning:   ?bool SDLView::mNeedsDisplay? [-Wreorder]
  bool     mNeedsDisplay;
           ^
SDL/SDLView.cpp:32:1: warning:   when initialized here [-Wreorder]
 SDLView::SDLView(int16_t inX, int16_t inY, uint16_t inWidth, uint16_t
inHeight)
 ^
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SDL/SDLView.cpp > SDL/SDLView.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
BBBDisplayApp.cpp -o BBBDisplayApp.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
BBBDisplayApp.cpp > BBBDisplayApp.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
ChargeController.cpp -o ChargeController.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
ChargeController.cpp > ChargeController.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SPSDisplayApp.cpp -o SPSDisplayApp.o
SPSDisplayApp.cpp: In member function ?virtual bool SPSDisplayApp::init()?:
SPSDisplayApp.cpp:85:11: warning: unused variable ?labelFontBold?
[-Wunused-variable]
  SDLFont* labelFontBold = SDLFont::fontForName("HelveticaNeue-Bold.ttf",
12);
           ^
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
SPSDisplayApp.cpp > SPSDisplayApp.d
g++ -c -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
TristarMPPT.cpp -o TristarMPPT.o
g++ -MM -g -Wall -I. -ISDL -Wno-unknown-pragmas -D_REENTRANT -std=gnu++0x
TristarMPPT.cpp > TristarMPPT.d
g++ spa.o SDL/SDLDisplay.o SDL/SDLFont.o SDL/SDLLabel.o SDL/SDLSurface.o
SDL/SDLView.o BBBDisplayApp.o ChargeController.o SPSDisplayApp.o
TristarMPPT.o -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lSDL_ttf
-lmodbus -lpthread -o app
jpg at trusty-laptop:~/Desktop/sdlq/SPSDisplay/SPSDisplay/trunk$

On Thu, Jul 3, 2014 at 4:59 AM, Rick Mann wrote:

Maybe not, unless they don’t build cleanly. Also, I’m trying to build the
Xcode Framework, not the regular lib.

Sylvain, here’s a small sample:

    https://pastee.org/wda6

It produces this:

http://cl.ly/image/1N1h232k0B1g/Screen%20Shot%202014-07-03%20at%202.56.49%20.png

This is with the 2.0.11 SDL 1.2 Framework.

On Jul 3, 2014, at 02:03 , Jonathan Greig wrote:

SDL and SDL2 doesn’t really take very long to build.

I got it to build and run on Kubuntu 14.04 but all I got was a black
screen and it jacked my resolution to 640x480. I’m not very fluent with OSX
as I am Linux.

On Thu, Jul 3, 2014 at 3:45 AM, Rick Mann wrote:
Hmm. I’m using the Framework. I’d have to get the whole thing and build
it.

On Jul 3, 2014, at 00:39 , Sylvain Becker <@Sylvain_Becker> wrote:

Make sure you are using the latest version of the file “SDL_ttf.c” for
the SDL_ttf mercurial trunk ! (I mean not only the SDL2 version)

Which size are you using for the font ?

I won’t be able to run your code as I dont use sdl-1.2 anymore, and
dont want to port the whole app.
Please, write a minimal test case if you want me to run it !
Then, I will try it tomorrow.

To answer your question : if I remember correctly, you can save
surface to image with SDL_SaveBmp

Cheers,
Sylvain

On Thu, Jul 3, 2014 at 9:09 AM, Rick Mann wrote:

I tried it on the BeagleBone Black/Debian, I get the exact same
results. I’m not very well versed with git, but I’ve put my code up there:

   https://github.com/JetForMe/SPSDisplay

On Jul 2, 2014, at 14:09 , Sylvain Becker <@Sylvain_Becker> wrote:

I mixed SDL_BlitSurface and SDL_RenderCopy, the DstRect is indeed
used
for positionning only.

Your font, with SDL2, looks correct to me …

Also, you can try with TTF_RenderUTF8_Shaded, instead of
TTF_RenderUTF8_Blender

I am almost sure that you can use the SDL2_ttf2 with SDL-1.2
Give a try only replacing SDL_ttf.c

On Wed, Jul 2, 2014 at 10:54 PM, Rick Mann wrote:

On Jul 2, 2014, at 11:23 , Sylvain Becker <@Sylvain_Becker> wrote:

  • give a try with different fonts.

I tried it with an OTF version of the font, and while the glyph
positioning is different, it’s still all over the map.


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker

In the mean time use another font :slight_smile: or try fixing is with SDL2 environment .

If I knew how to get fbdev support working in SDL2, I would! That’s the only reason I can’t. OpenGL isn’t working on the BeagleBone Black.On Jul 3, 2014, at 12:07 , Sylvain Becker <sylvain.becker at gmail.com> wrote:


Rick

I tried with the latest version and I have the same rendering issue !
I opened a bug for that :
Some glyph are misplaced · Issue #50 · libsdl-org/SDL_ttf · GitHub
Maybe add yourself to the CC list to know about it …

Thanks!

So, you think a different font works? I’ll take any modern-looking font that has the numbers, decimal, and colon all monospaced.On Jul 3, 2014, at 12:07 , Sylvain Becker <sylvain.becker at gmail.com> wrote:


Rick

I mean the problem is there also in SDL2 with this font and latest SDL_ttf.
If you get it solve for SDL2, very likely, it will be solved for SDL1.2 as well.

I am not sure about monospaced font. it worth a try…On Thu, Jul 3, 2014 at 9:28 PM, Rick Mann wrote:

On Jul 3, 2014, at 12:07 , Sylvain Becker <@Sylvain_Becker> wrote:

I tried with the latest version and I have the same rendering issue !
I opened a bug for that :
Some glyph are misplaced · Issue #50 · libsdl-org/SDL_ttf · GitHub
Maybe add yourself to the CC list to know about it …

Thanks!

So, you think a different font works? I’ll take any modern-looking font that has the numbers, decimal, and colon all monospaced.


Rick


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Sylvain Becker

Indeed it looks pretty bad on the small text.

Here I use HelveticaNeue-Regular you posted on the top, SourceSansPro-Regular.ttf, and then SourceSansPro-Regular.otf on the bottom. All of them are 16 point height.

You can get source sans pro from http://sourceforge.net/projects/sourcesans.adobe/

The otf varient is drawn slightly different due to the FreeType2 2.5 which includes Adobe’s rasterizer, the ttf verrsion uses old rasterizer. I think if you’re using FreeType 2 below version 2.4.12, the output would be on par or even worse than ttf version though.

Indeed it looks pretty bad on the small text.

Here I use HelveticaNeue-Regular you posted on the top, SourceSansPro-Regular.ttf, and then SourceSansPro-Regular.otf on the bottom. All of them are 16 point height.

[Image: https://95858663ef71a996ed181108f6cd132eebb2d248.googledrive.com/host/0B2Owi7msgdqDUU8xejNJMzhxY28/Screenshot%20from%202014-07-04%2004:34:47.png ]

The otf varient is drawn slightly different due to the FreeType2 2.5 which includes Adobe’s rasterizer, the ttf verrsion uses old rasterizer. I think if you’re using FreeType 2 below version 2.4.12, the output would be on par or even worse than ttf version though.

You can get source sans pro from http://sourceforge.net/projects/sourcesans.adobe/

Thanks. How do I use SourceSans? I don’t see a plain .otf version in there.

I have FreeType 2.5.3 installed on this machine, although I’m not sure SDL 1.2 Framework is using it (I think it embeds its own FreeType).On Jul 3, 2014, at 14:47 , mr_tawan <mr_tawan at hotmail.com> wrote:

Indeed it looks pretty bad on the small text.

Here I use HelveticaNeue-Regular you posted on the top, SourceSansPro-Regular.ttf, and then SourceSansPro-Regular.otf on the bottom. All of them are 16 point height.

The otf varient is drawn slightly different due to the FreeType2 2.5 which includes Adobe’s rasterizer, the ttf verrsion uses old rasterizer. I think if you’re using FreeType 2 below version 2.4.12, the output would be on par or even worse than ttf version though.

You can get source sans pro from http://sourceforge.net/projects/sourcesans.adobe/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rick