summaryrefslogtreecommitdiff
path: root/src/text.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-07-15Render font outlines using TTF_SetFontOutlineThorbjørn Lindeijer1-3/+3
Rather than rendering the same texture 4 additional times, render a specific outline version of the text. While reducing the number of times the text is drawn, it does increase font texture use. Result is a generally prettier outline due to rendering it properly at sharp corners of the characters. The shadow for outlined text is now also thicker, as appropriate. As part of this change, the `TextRenderer` class was merged into the `Graphics` and `TrueTypeFont` classes. There seemed to be little point in having a separate function for this, apart from needing more static casts to `Graphics*`. Also fixed an issue where the font style was not being restored after adjusting the font scale, when using an older SDL_ttf than 2.0.18. Closes #87
2025-03-24Define the GUI theme in XMLThorbjørn Lindeijer1-40/+23
Now all images used by the various UI widgets are defined in a `theme.xml`, removing hardcoded requirements on the size of images, borders and sub-images and their locations. The `colors.xml` file was merged into this new file as well. The `<img>` element defines either a plain image, or a 9-scale that is automatically rendered at the size of the widget when any of the `left`, `right`, `top` or `bottom` attributes are given. The `x`, `y`, `width` and `height` attributes determine the sub-rectangle within the image referenced by `src`. `x` and `y` default to 0 and `width` and `height` default to the imge size. The `<state>` element defines in which state its images are used by setting its `selected`, `disabled`, `hovered` or `focused` attributes to either `true` or `false`. Only the first matching state is rendered. The `Text` and `SpeechBubble` classes now use the same skin to draw the bubble, as well as using a newly introduced `BUBBLE_TEXT` color from the theme palette.
2025-03-17Have ImageRect automatically initialize and clean upThorbjørn Lindeijer1-1/+4
2025-02-26Use ResourceRef for all resource typesThorbjørn Lindeijer1-2/+1
All ResourceManager functions that load resources now return respective ResourceRef values, which helps to make sure resources are properly cleaned up. The Sound class was cleaned up and now also allows SoundEffect resources to be unloaded. The Animation class now keeps its ImageSet loaded only as long as necessary. Previously, SimpleAnimation and ParticleEmitter would keep the ImageSet loaded indefinitely by never decreasing its reference count. Reduced duplicated animation loading code between SimpleAnimation and ParticleEmitter.
2025-01-20Made client config statically typedThorbjørn Lindeijer1-4/+3
This makes accessing the config values much faster, since it no longer needs to do a lookup nor string conversion, which means we could remove some needless copying of the values. Overall it makes it easier to find out where settings are used and it puts the defaults along with the declaration. Options with default values are no longer saved to the config file. This does not include unrecognized options, which are kept around to provide some compatibility with older clients. While most basic options have kept the same name, more complicated settings like window geometry, shortcuts, outfits, etc. now have their own XML elements. Older clients will ignore these and erase them when saving the configuration.
2024-10-08Use Timer for duration of blinking nameThorbjørn Lindeijer1-10/+11
This fixes the duration on 1500 ms, whereas before it was dependent on the framerate, blinking for 200 frames.
2024-01-29Apply C++11 fixitsThorbjørn Lindeijer1-13/+3
modernize-loop-convert modernize-deprecated-headers
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer1-2/+2
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2010-12-06Removed superfluous #includes taken from checkheaders list.Yohann Ferreira1-2/+0
Resolves: Mana-Mantis #265. Trivial fix.
2010-08-03Move Theme and UserPalette to the resources folderJared Adams1-1/+1
Reviewed-by: Yohann Ferreira
2010-07-28Centralized configuration default values using the VariableData system.Yohann Ferreira1-2/+2
Please note that I didn't turned all the getValue() call into new ones, simply because I have to have config object initiated which is not forcefully the case the branding file. Resolves: Manasource Mantis #170.
2010-05-24Show selected target with bold font.Andrei Karas1-4/+9
Also fix possible memory corruption. Signed-off-by: Jared Adams <jaxad0127@gmail.com>
2010-03-05Rename SkinLoader to ThemeJared Adams1-2/+2
Also merge the guialpha ConfigListener into Theme. Reviewed-by: Thorbjørn Lindeijer
2010-02-28Make the gui more themeable and distribute two themesJared Adams1-2/+2
The older gray theme and the new wood theme are available as themes. The gray theme needs some new graphics for hilights. Add a theme option for branding and add path/to/branding/data to the PhysFS search path. Reviewed-by: Thorbjørn Lindeijer Reviewed-by: Chuck Miller
2010-02-22Modify copyright headersFreeyorp1-1/+2
2010-02-20License header update for The Mana ClientThorbjørn Lindeijer1-3/+2
2010-02-07Updated Copyright year to 2010!Bertram1-1/+1
Also added the update copyright tool from the Wormux Team. ( And not forgetting credit's due. :P )
2010-01-12Standardize header orderJared Adams1-2/+2
Also remove some extra new lines and fix eAthena's PartyTab define guards.
2010-01-11Cleanup GUI classesJared Adams1-3/+4
Moved remaining widgets into widgets folder, standardized include order, moved TextRenderer out.
2010-01-10Change code styleAndrei Karas1-2/+4
2009-05-10Don't show player names and overhead text in boldBjørn Lindeijer1-5/+4
I think it makes the game look too messy. But we should probably add an option to allow enabling this.
2009-03-27Fixed some positioning issuesBjørn Lindeijer1-0/+5
Started with not being able to click NPCs properly, and I ended up correcting the draw positions of overhead text, targets and sprite ordering. It's now a bit more straight-forward. The position of a being is simply in the middle of the sprite at the bottom. When drawing the sprite, an offset remains because all the sprites are compensating for getting drawn half a tile to the left and one tile up.
2009-03-23Merge branch 'aethyra/master'Bjørn Lindeijer1-3/+1
Conflicts: Many files.
2009-03-14Exposed the progress bar colors to the color management tab.Ira Rice1-1/+1
Signed-off-by: Ira Rice <irarice@gmail.com>
2009-03-12Make use of the new available colorsMajin Sniper1-4/+6
This patch lets all being derivatives use the palette to set their name's colors. Text Particle Effects all respect the new settings. Some widgets were updated to use the colors.
2009-03-12Extending the internal handling of colorssniper1-1/+1
The internal storage for colors was in the file color.h/color.cpp. It mainly managed the colors in the chat. The Color class was extended to be more generic now and it stores gcn::Color objects instead of integers now. A lot of new colortypes are now available, though not many of them are used for now, that will come in the next patches. The Color class was renamed to Palette and color.{h,cpp} to palette.{h,cpp} to better describe its purpose. The color config gui now lists the new colors, even changes them, but the result is not displayed properly for now.
2009-03-12Added a class for rendering of floating textsniper1-19/+5
This is a header only-class that merges the textrendering of the TextParticle and Text classes. It is done to reduce code duplication and to prepare some color configuration gui.
2009-03-12Make use of the new available colorsMajin Sniper1-3/+3
This patch lets all being derivatives use the palette to set their name's colors. Text Particle Effects all respect the new settings. Some widgets were updated to use the colors.
2009-03-12Added a class for rendering of floating textsniper1-31/+5
This is a header only-class that merges the textrendering of the TextParticle and Text classes. It is done to reduce code duplication and to prepare some color configuration gui.
2009-02-15Merge commit 'aethyra/master'Bjørn Lindeijer1-5/+1
Conflicts: CMakeLists.txt configure.ac data/help/header.txt packaging/windows/setup.nsi po/POTFILES.in src/being.cpp src/being.h src/game.cpp src/gui/color.cpp src/gui/color.h src/gui/equipmentwindow.h src/gui/popupmenu.cpp src/gui/recorder.cpp src/gui/setup_colors.h src/gui/setup_keyboard.cpp src/gui/setup_keyboard.h src/gui/skill.cpp src/gui/speechbubble.cpp src/gui/speechbubble.h src/gui/table.cpp src/keyboardconfig.cpp src/keyboardconfig.h src/localplayer.cpp src/main.cpp src/main.h src/map.cpp src/resources/colordb.cpp src/resources/colordb.h src/resources/emotedb.cpp src/resources/emotedb.h src/text.cpp src/text.h src/tmw.rc src/winver.h
2009-02-11Changed spelling from colour to color.Philipp Sehmisch1-5/+5
2009-02-11More capitalization fixes for 'color'Bjørn Lindeijer1-2/+2
Hopefully these are the last ones. :)
2009-02-10Changed spelling from colour to color.Philipp Sehmisch1-6/+6
2009-02-09Fixed up the copyright headersBjørn Lindeijer1-19/+21
Decision is to go with exact authors when some file is basically done by one person, and in most other cases assign TMW or Aethyra team copyright when multiple people from those teams have been involved. Also, the first summary line should now contain the subset of functionality that the file is part of, not the name of the whole project.
2009-02-09Merged with Aethyra master as of 2009-02-09Bjørn Lindeijer1-4/+2
Conflicts: A lot of files...
2009-02-09Fixed up the copyright headersBjørn Lindeijer1-1/+1
Decision is to go with exact authors when some file is basically done by one person, and in most other cases assign TMW or Aethyra team copyright when multiple people from those teams have been involved. Also, the first summary line should now contain the subset of functionality that the file is part of, not the name of the whole project.
2009-02-09Merged with Aethyra master as of 2009-01-27Bjørn Lindeijer1-3/+4
Conflicts: Almost everywhere.
2009-02-07Some more include cleanups.Ira Rice1-4/+2
Signed-off-by: Ira Rice <irarice@gmail.com>
2009-01-24Updated DejaVuSans ttf file, as well as adding the bolded version, whichIra Rice1-3/+3
is used in a few spots. Signed-off-by: Ira Rice <irarice@gmail.com>
2009-01-24Use standard GUI font also for speech and namesBjørn Lindeijer1-10/+25
The speech bitmap font can't handle unicode, so it has now been replaced by the standard GUI font, drawn with a shadow for chat and with a full outline for names.
2009-01-24Use standard GUI font also for speech and namesBjørn Lindeijer1-10/+45
The speech bitmap font can't handle unicode, so it has now been replaced by the standard GUI font, drawn with a shadow for chat and with a full outline for names.
2009-01-24Added speech bubble background by QOALBjørn Lindeijer1-10/+61
2009-01-23Removed unnecessary references to The Mana World in code headersBjørn Lindeijer1-2/+1
This dates back to the old days of TMW, but the usage instructions of GPLv2 don't mention this being necessary. Since it doesn't add anything, avoid the branding in these sections.
2009-01-23Removed unnecessary references to The Mana World in code headersBjørn Lindeijer1-4/+4
This dates back to the old days of TMW, but the usage instructions of GPLv2 don't mention this being necessary. Since it doesn't add anything, avoid the branding in these sections.
2008-11-18Pedantic fixes to the client, where I alphabetized all of the include Ira Rice1-2/+1
statements, as well as removing the new skill dialog, which we do not, nor will we use (if we do, it'd be a new one that we'd make). WARNING!!! This, and all other previous builds have a linker error for the Gnome libraries version 4.3.2 on my setup. It's assumed that this is also the case for other users of this library as well. I'm currently assuming that there's a bug in the compiler itself, and will look into reporting this, but in the mean time, it doesn't build for these users, unfortunately. Sorry about this.
2008-11-16Got rid of CVS/Subversion $Id$ markersBjørn Lindeijer1-2/+0
I don't know why we dealt with these things for so long. Did we ever get anything out of it?
2008-10-23Fixed a crash that I caused earlier when I was fixing compiler warnings. Caused Ira Rice1-11/+0
by adding a new destructor.
2008-10-23Removed a few compiler warnings.Ira Rice1-0/+11
2008-08-28Accepted Patch by Scraggy that moves text in such a way that no text overlapsBjørn Lindeijer1-0/+104