Commit Graph

64 Commits

Author SHA1 Message Date
NischayDiwan
4b83dd78d6 GRAPHICS: Refactor MacFont scaling into reusable methods
- The refactoring code for MacFont that magnifies the font on a surface and then uses a grayscalemap to refactor the scaling, is pushed back into a resuable method in the base font class.
 - surface magnigy funtion transfer and scaleSingleGlyph method add to the font class.
2023-04-16 21:13:50 +02:00
sluicebox
b578f5be7b GRAPHICS: Expose Font leading and descent values
The leading value in Macintosh fonts is the space between lines,
defined as the space between a descent line and the ascent line
below it. Clients need this to draw text and calculate its height
as classic Macintosh did.
2022-11-06 23:05:20 -08:00
Paul Gilbert
a2a33b8f19 GRAPHICS: Added getFontName method to TTFFont 2022-03-14 21:57:14 -07:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Thierry Crozat
3203346dfb GRAPHICS: Do not use ellipsis by default when drawing text
This makes the default for drawString consistent with the default
for getBoundingBox.

This should also fix ellipsis being used by mistake in some games
(this was reported in Myst Masterpiece Edition for the menu screen).
2021-08-01 17:22:13 +02:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Thierry Crozat
a3f3d71c57 GRAPHICS: Expose ascent value in font class 2021-03-23 20:25:23 +00:00
Paul Gilbert
4142f7b7f8 GRAPHICS: Allow TTFFont to handle ManagedSurfaces with transparent pixels 2021-02-26 17:58:19 -08:00
antoniou79
5e467e1bbc GRAPHICS: FONT: Clarification for combo of wrapping flags
for the wordWrapTextImpl and the kWordWrapEvenWidthLines, kWordWrapOnExplicitNewLines bit flags
2020-12-09 18:53:42 +02:00
Bartosz Gentkowski
529b64d8cd DOXYGEN: Review of high prio files from graphics
Editing doxygen comments in:

- cursorman.h
- font.h
- managed_surface.h
- pixelformat.h
- surface.h
2020-12-01 23:24:37 +00:00
Eugene Sandulenko
87beb98b95 GRAPHICS: Turn set of bool parameters for wordWrap() to a bitfield 2020-10-16 23:52:18 +02:00
aryanrawlani28
aa33fc2354 GRAPHICS: Use template for handleEllipsis 2020-08-30 14:43:41 +02:00
aryanrawlani28
ad78777bc6 GUI: Handle ellipsis shortening of text when drawing u32 strings 2020-08-30 14:43:41 +02:00
aryanrawlani28
51d95f8978 GRAPHICS: move start + end to Graphics::TextAlign 2020-06-22 00:03:02 +02:00
Paul Gilbert
4fc86e1bc9 GLK: COMPREHEND: Refactoring drawing code 2020-06-02 18:22:10 -07:00
Thanasis Antoniou
4630895ccc COMMON: Explain new params for wordWrapText() 2019-08-02 00:08:38 +02:00
Thanasis Antoniou
1bca3de594 COMMON: Support text wrapping with even width line segments
The new arguments are optional. The lines segments will be close to the same width.

The algorithm is similar to the one we had for Blade Runner but not exactly the same, since that one would wrap a line at a white space after the theoretical split point (quotient of full line text width divided by target lines number)
2019-08-02 00:08:38 +02:00
Paul Gilbert
e5b73b2899 GRAPHICS: Add deltax optional parameter to Font drawString U32String version 2018-11-14 19:00:17 -08:00
Eugene Sandulenko
dc640ab50a GRAPHICS: Added optional initial line width ot text wrapper 2017-01-29 18:41:07 +01:00
Johannes Schickel
ce1be463c2 GRAPHICS: Implement convenience Font::drawChar taking ManagedSurface. 2016-03-21 02:03:12 +01:00
Paul Gilbert
433a2daa6a GRAPHICS: Added ManagedSurface and Screen classes 2016-03-14 20:56:14 -04:00
Johannes Schickel
d55cd8f3b4 GRAPHICS: Allow to query the bounding box of chars/strings drawn with Font API. 2014-09-03 22:55:48 +02:00
Johannes Schickel
53332e8066 GRAPHICS: Make GPL headers consistent in themselves. 2014-02-18 02:39:34 +01:00
Johannes Schickel
9da09f5846 GRAPHICS: Allow Font to accept U32String as strings. 2013-11-23 21:34:54 +01:00
Johannes Schickel
afa3f50b8a GRAPHICS: Let Font take uint32 as character codes.
This is required to support UTF-32 strings but does not make them work
automatically!
2013-11-23 21:34:54 +01:00
Johannes Schickel
9f3fbe1bd7 GRAPHICS/GUI: Implement kerning support for Font.
This adapts the related graphics code, which is the generic Font API and the
TTF font implementation.

It furthermore adapts the GUI to properly take care of kerning in text input
widgets.
2012-01-29 16:26:20 +01:00
Johannes Schickel
8201df7bb6 GRAPHICS: Move NewFont code to a separate file. 2011-07-01 21:10:25 +02:00
Thierry Crozat
592cca5402 GRAPHICS: Get rid of kSODFont (ScummFont)
OSD is now using the kGUIFont instead. The main advantage is that
the kGUIFont can be used for translated text while only ASCII
characters were present in ScummFont.
2011-06-06 23:20:08 +01:00
Max Horn
90d3fc9f5b GRAPHICS: Rename some members of NewFont 2011-05-23 12:13:02 +02:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Johannes Schickel
f9ebeb330b GRAPHICS: Some basic documentation for Font.
svn-id: r55143
2011-01-07 12:43:00 +00:00
Max Horn
abe1959d36 COMMON: Simplify DECLARE_SINGLETON macro
This makes it possible to write
  DECLARE_SINGLETON(foo);
instead of
  DECLARE_SINGLETON(foo)
without causing a warning about an extra semicolon.
The extra semicolon helps some editors at parsing the C++ code.

svn-id: r54258
2010-11-16 08:23:13 +00:00
Jordi Vilalta Prat
354499c737 Fix some typos in a comment
svn-id: r49488
2010-06-07 17:17:41 +00:00
Max Horn
c934642bdb COMMON: Move typedef StringList from str.h to new header str-array.h
This removes the dependency on array.h from str.h.
Also, begun migration from the confusing type name "StringList" to
the more appropriate StringArray.

svn-id: r48282
2010-03-18 15:09:24 +00:00
Johannes Schickel
6b44a09a52 Hopefully fixing linking on MSVC:
svn-id: r46329
2009-12-10 21:40:38 +00:00
Johannes Schickel
0d43cc61d2 Cleanup: remove "s_initialized" from CursorManager and FontManager implementation, these classes are Singletons, so they will ever only be initialized once at most anyway.
svn-id: r46313
2009-12-09 17:05:23 +00:00
Max Horn
fb5e747565 GRAPHICS: Change font code to be identical on all platforms
svn-id: r46309
2009-12-09 16:44:48 +00:00
Max Horn
3399c3aeb6 Change doxygen inline comments from "//!" to "///" as proposed on -devel
svn-id: r44802
2009-10-08 21:28:57 +00:00
Eugene Sandulenko
b0f7f2e8d4 Implement widget property "textalign". Added it to all theme layouts
svn-id: r41265
2009-06-06 17:51:41 +00:00
Max Horn
eb27307c12 minor tweaks
svn-id: r35036
2008-11-13 11:20:43 +00:00
Max Horn
c0f82d3518 Renamed Graphics::TextAlignment -> Graphics::TextAlign and merged it with GUI::ThemeEngine::TextAlignVertical
svn-id: r35023
2008-11-12 14:30:16 +00:00
Jordi Vilalta Prat
d6c34bdc4b Fixed the spaces before tabs.
svn-id: r30667
2008-01-28 00:14:17 +00:00
Max Horn
218e132e37 Updated legal headers in source files, based on what Pidgin (the IM client formerly knowns as Gaim) does; added new (incomplete) COPYRIGHT file; updated copyright dates in a few spots
svn-id: r27024
2007-05-30 21:56:52 +00:00
Max Horn
00b9bc7b36 Removing lots of superfluous semicola (see mail by David Weinehall on scummvm-devel)
svn-id: r26594
2007-04-25 19:31:23 +00:00
Torbjörn Andersson
49af7d44c2 Applied patches from bug report #1276480, "GUI: Accented characters". This
changes quite a lot of things in the font renderer and the convbdf tools, so
there may be regressions, but we want this feature for 0.9.0.

svn-id: r23208
2006-06-20 22:50:27 +00:00
Johannes Schickel
e9cbf5fcbd - Moves Graphics::loadFont to Graphics::NewFont::loadFont
- adds code for caching of fonts (just for Graphics::NewFont)
- implements cache using in the modern theme for custom fonts
- adds cache file for current normal font in the theme zip file

svn-id: r21952
2006-04-16 19:54:39 +00:00
Max Horn
1e47edcd22 cleanup
svn-id: r21921
2006-04-15 21:29:41 +00:00
Johannes Schickel
96cf7028b9 - implements .bdf font loader based on convbdf (sure could have some clean up)
- adds three different font styles to the themes (normal, bold (default one), italic)
- implements code for specifing the font files in the theme config ('fontfile_normal','fontfile_bold' and 'fontfile_italic' in the 'extra' section)
- changes EditTextWidget to use the normal font (has some minor aligment problems with the caret now, though)
- extends the FontManager (new functions: getFontByName, assignFontToName, removeFontName)
- adds the font style constans to the builtin constants for the evaluator)

svn-id: r21868
2006-04-14 02:16:55 +00:00
Max Horn
13d6a56867 Change CVS keywords to SVN keywords
svn-id: r20519
2006-02-11 10:10:44 +00:00