Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - NeomerArcana

Pages: [1]
2
Graphics / Fonts and .ttf Metrics
« on: April 21, 2014, 12:40:05 pm »
Hi,

I've had an ongoing problem with SFML which I've also noticed in SFGUI. Basically, it's that a lot of .ttf fonts include accented unicode characters which gives the font a large Ascent and Descent value in the font metrics. Most programs I think ignore this stuff when typing text and sort of recalculate it on their own, but not the case in SFML (and therefore SFGUI).

So for example, outputting text in SFML at position 0,0 makes the text appear to be more at like 0,20 because of the whitespace above to make room for ascent characters. But if I then .getLocalBounds() on the object the local bounds do not start at 0,0 (my guess is because it calculates the ACTUAL bounds of the displayed text?).

I've tried downloading FontForge to manually edit the various Ascender and Descender values for my font, but it doesn't seem to have much of an effect. Changing the EM size seems to have an effect, but it's like SFML (or maybe it's FreeType behind the scenes) is ignoring it.

Does anyone know how I can edit the font, what specific values to change, to get it to use whatever value I want to decide where the "top" of the text could be? Currently the "top" is like the top of an accented uppercase A, but I want it to be the top of a regular A.

Is there anything I can do to the source of SFML to change the way it reads the font as well (if it's needed)?

3
General / [SOLVED] Help with SFML2.1 and Mingw-builds
« on: November 22, 2013, 10:20:16 am »
Hi all,

I'm trying to successfully build SFML2.1 using the latest from http://code.google.com/p/mingw-builds/downloads/list. I'm doing this specifically because it supports std::thread on windows (I do not want to use boost or any other library).

I managed to build the libraries using cmake. But the when I compile a project using this new compiler and libraries I get a bunch of "multiple definition of" errors. (The project successfully compiles under sfml2.1 and gcc 4.7.0 (that comes with Code::Blocks 12.11))

The only thing I've noticed is that the configuration in cmake lists the code:blocks version of mingw32-make as the CMAKE_MAKE_PROGRAM. I'm unable to edit it due to the endless loop error you get for changing toolchain executables. I've tried changing the environment PATH to use my new google sourced compilers mingw32-make but it doesn't seem to pick it up.

Anyway, I'm not sure that's the problem.

Any help would be appreciated. If anyone can try building and compiling an SFML test project with the above mingw-build project it would help a lot.

4
Graphics / Stroke a Vertex Array
« on: September 13, 2013, 09:11:20 am »
Hi All,

I've been scratching my head on this one for a little and I'm really just after some guidance.

I've searched google and the forums and can't find an answer, or at least one I understand. I'm trying to stroke an array of vertices. Basically, exactly like how you stroke a path in Photoshop with a Brush.

I understand that SFML can't do this out of the box.

My use case is I have a berzier curve function which I use to calculate the coords of say 10 points along the curve. I'm then adding these points to a Vertex Array as a Line Array. I'd now like to drawn a nice thick 6 pixel line (brush) along this path.

I've sort of come to the conclusion that I'd need to do this using a Polygon. So I thought if I calculate the direction vector at each point, I could then calculate the point that's at a right angle direction to either side of my original point at a distance of half the stroke width. Then I would be able to add each of these points to a Vertex Array working along the two points that are 90 degrees from the first point, 90 degress from the second point and then at the last point I can work my way back down along the 270 degree angle points.

Then I can just fill the resulting polygon that's the width I want, and centered directly on the top of my original Vertex array.

I would like to get some validation on this before I go to all the effort of learning the necessary vector math. Is there a better way to do this? Has someone already gone to the effort to code it up for me?

Pages: [1]