summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fontwrapper-ft.cc
Commit message (Collapse)AuthorAgeFilesLines
* Drop some useless parentheses around comparisons.Adam Borowski2014-01-101-1/+1
|
* More formatting fixes for return (...);Neil Moore2013-11-151-1/+1
|
* Don't allocate pointless iterators.Adam Borowski2013-11-151-1/+1
| | | | | map or set.count() can test the presence of a given key and return 0 or 1 outright.
* Use unique_ptr instead of auto_ptr (emulated for non-C++11).Adam Borowski2012-08-281-1/+1
| | | | | | This stops the tons of warnings, while allowing building for both old and new C++ standards. And if we wanted to use shared_ptr or something, now we can without being ambiguous.
* Use std namespace.Raphael Langella2012-08-261-21/+20
| | | | | | | | | | | | | I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
* Don't crash on font rendering when there's anything outside ascender..descender.frogbotherer2012-07-281-30/+25
| | | | | | | This worked for DejaVu Sans, but failed on a number of other fonts. (cherry picked from commit e0ba98f9c56185d8bc650df4df9d49b4bb428e4b) [commit message rewritten -- 1KB]
* Merge branch 'unicode-tiles'Adam Borowski2012-07-111-133/+246
|\ | | | | | | | | | | It lacks an actual font yet, but I realized we need to check if drivers people use actually support sub-textures -- and if not, there'll be some rethinking needed.
| * Force a flush if we get 255 glyph substitutions in a text block.Adam Borowski2012-07-091-0/+16
| |
| * Fix some type confusion.Adam Borowski2012-07-091-8/+8
| | | | | | | | | | While ucs_t happens to be "unsigned int" inside, labelling some random indices this way is likely to introduce errors in the future.
| * Evict glyph loading to a separate function.Adam Borowski2012-07-091-100/+108
| | | | | | | | It got unmanageably large.
| * Fix an off-by-one crash on loading an outline font.Adam Borowski2012-07-091-25/+21
| |
| * more efficient font rendering using glTexSubImage2Dfrogbotherer2012-07-081-43/+29
| |
| * Fix droppings of old glyphs appearing on a new glyph's edges.Adam Borowski2012-07-011-2/+2
| |
| * Fix a potential integer overflow.Adam Borowski2012-07-011-1/+1
| | | | | | | | GCC seems to handle values above 255, but let's better play it safe.
| * Fix a crash on drawing out of a character's bounds.Adam Borowski2012-07-011-1/+1
| |
| * A pixel = 1px, 4 bytes.Adam Borowski2012-06-251-2/+3
| |
| * Formatting.Adam Borowski2012-06-251-23/+21
| |
| * Don't let debugging printf spew invalid characters.Adam Borowski2012-06-251-6/+26
| | | | | | | | | | | | | | | | printf("%c", 191) is an undefined operation, and won't work on any modern system. Better to just write what was requested. Using "%lc" may not work in non-Unicode locales, but hey, it's a debugging thing.
| * improved unicode support with more efficient use of texturesfrogbotherer2012-06-251-62/+138
| |
| * added proper unicode support at the cost of some memory overheadfrogbotherer2012-06-251-98/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The maximum number of glyphs is fixed at 256, (which is enough for languages with latin-like characters), but is easily increased via some constants in fontwrapper-ft.cc, with a memory trade-off. Features of this code: - any character in the font can be rendered - if crawl tries to render more than the max number of glyphs, it will crash - if crawl tries to render a glyph not in the font, an upside-down question mark will be printed instead - for each fontwrapper instance (font face, size and attributes), this keeps an array of pixels and an equivalent texture in memory for 256 possible glyphs. This is why increasing the number of available glyphs pushes memory use up
* | Some more return deparenthesization.Adam Borowski2012-07-051-3/+3
|/
* Make a few functions static.Adam Borowski2012-04-201-1/+1
|
* Consistently use a space after flow control statements.Adam Borowski2011-12-021-1/+1
|
* First prototype of webtiles.Florian Diebold2011-06-261-2/+2
| | | | | | Conflicts: crawl-ref/source/startup.cc
* heftig's patch for "light" freetype hinting.Adam Borowski2011-05-221-2/+5
| | | | | | | | | It looks worse to me, but that's a matter of taste. Preferably, we'd use system settings, but that'd require using fontconfig (needed for full Unicode support anyway) and can't be done on Windows since system settings there are not applicable to FreeType. We'd be able to at most switch between sub-pixel and grayscale hinting, not "light" hinting as in this option.
* Work around FreeType having problems opening files on Windows.Adam Borowski2011-04-141-1/+17
| | | | | | | | | | | | | According to its documentation, FT_New_Face() expects the file's name in UTF-8 regardless of the system locale. Too bad, there's a bug where sometimes on Windows an 8 bit code page is used instead: http://www.mail-archive.com/freetype@nongnu.org/msg00939.html Since we don't know if the version we're talking to is fixed or not, it's safer to load the font file ourselves. This fixes cases where zipped (not installed) builds were put into a directory with a non-ASCII name.
* Show FreeType errors on Windows, make them fatal.Adam Borowski2011-04-141-16/+4
| | | | | There's no stderr there for graphical programs, except for cygwin which adds it as a part of Unix emulation.
* Fix tiles compile.Adam Borowski2011-04-041-1/+1
| | | | | | | The code for menu icons removing the hotkey header is ugly like hell :( Not rewriting this sanely for now, but it needs to be killed with fire, and the header stored separately.
* Merge branch 'master' into unicodeAdam Borowski2011-03-131-2/+4
|\
| * Shift the tooltip to the right, so the messages are still readable.Johanna Ploog2011-01-191-2/+4
| | | | | | | | | | This makes it less likely that the tooltip information covers the message area.
* | Handle fixed-width characters of width 2 in tiles.Adam Borowski2010-12-171-3/+11
| |
* | Let tiles output our UTF-8 encoded strings -- only the ISO-8859-1 subset for ↵Adam Borowski2010-09-271-18/+33
|/ | | | | | now. Word wrapping is yet to be corrected, just like in other UIs.
* fontwrapper-ft.cc: use malloc()/free() instead of alloca()Steven Noonan2010-05-161-4/+5
| | | | | | | | | | 'malloc.h' is missing on Mac OS X, but is needed to define alloca() on platforms such as MinGW. The easiest solution is to simply use a function other than alloca() for this task. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Include malloc.h in font-wrapper-ft.ccCharles Otto2010-05-151-0/+2
| | | | | Not having malloc.h included caused a linker error (undefined reference to alloca) for me on mingw.
* Clean up GL code function parameters.Enne Walker2010-05-141-5/+6
| | | | | | | Remove any non-const-reference parameters. Change const pointer parameters to const reference parameters. Change all draw(NULL, NULL) calls to just draw(). Also, refactor to remove pretranslate and prescale parameters from draw calls.
* Renaming struct GLWRect to be class GLWPrim.Enne Walker2010-05-141-4/+4
|
* Clean up storage of vertex colours in GLWRect.Enne Walker2010-05-141-4/+4
| | | | | | Storing member variable pointers to data, even const ones, is sketchy. Better to depend on compiler optimizations to eliminate redundant variable copies.
* Add "current colour" to GLState.Enne Walker2010-05-141-9/+6
| | | | | This simplifies code that was setting and unsetting the global current colour manually.
* Expose GL state to draw call API.Enne Walker2010-05-141-13/+6
| | | | | This avoids weird global state setting and then querying in the next function.
* Rename vert buffer 'push' to 'add' for clarity.Enne Walker2010-05-141-4/+4
|
* Code cleanup for triangles branch.Enne Walker2010-05-141-16/+15
| | | | Applying standards, simplifying code, removing redundant comments.
* Remove unused code from fontwrapper.Enne Walker2010-05-141-12/+0
| | | | State should always be set prior to drawing, so no need to restore it.
* Reuse the same buffer when drawing fonts.Enne Walker2010-05-141-12/+9
| | | | Don't alloc/delete every time a string is drawn.
* Remove unused 'flush' option on buffer drawing.Enne Walker2010-05-141-1/+1
| | | | | It's not really used anywhere at this point, and it's better to call clear explicitly when the draw buffer needs to be refilled.
* Removed GLStateManager::draw and GLPrimitive.Ixtli2010-05-141-96/+35
| | | | | | This will force all drawing to be done through VertBuffer. Signed-off-by: Enne Walker <enne.walker@gmail.com>
* Tilebuf now uses GLVertBuffer exclusively.Ixtli2010-05-141-32/+7
| | | | Signed-off-by: Enne Walker <enne.walker@gmail.com>
* Reduce dependencies on tilereg.h.Enne Walker2010-04-251-0/+1
| | | | | This was done by pushing ImageManager to tiletex.h, where it better belongs.
* Comment cleanup.Enne Walker2010-04-241-5/+0
|
* Move specific create funcs out of generic files.Enne Walker2010-04-241-0/+5
| | | | | | | glwrapper-ogl.cc, windowmanager-sdl.cc, and fontwrapper-ft.cc now contain the static functions for their parent class's factory create. This allows new implementations to be added without requiring modification of the generic file (with #ifdefs).
* General coding standards update.Enne Walker2010-04-241-39/+42
| | | | | | No spaces on parens. Line up function params. Sort includes more rationally. Put curly braces on their own line. Don't C-style typedef enum and structs. Put if-clauses on their own line.