summaryrefslogtreecommitdiff
path: root/src/fl_font_mac.cxx
AgeCommit message (Collapse)Author
2016-01-24Extracting OpenGL text calls. This is a minimum implementation for testing. ↵Matthias Melcher
Don;t worry. I have a cunning plan for rendering perfect antialiased text into OpenGL contexts quickly on all platforms. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11048 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-12-15Mac OS: it is clearer to initialize the fl_fonts global variable in ↵Manolo Gouy
font-related code. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10965 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-11-03The ATSU API (old API for text formatting) has been removed from SDK 10.11.Manolo Gouy
This fixes STR#3262 git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10878 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-16Correctly handle Unicode's 'Variation selectors' where a Unicode codepointManolo Gouy
modifies the glyph used to draw the previous Unicode codepoint. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10792 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-15Mac OS: The 'variation selectors' of Unicode change the glyph associated to ↵Manolo Gouy
the preceding unicode character. This defeats the procedure FLTK uses to compute text widths (precomputing the width of each used character) because the width of character n is not unique and potentially depends on character n+1. Therefore, we now remove variation selectors from the input string before drawing it. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10791 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-28Restored the possibility to call Fl::set_font()Manolo Gouy
in a global initializer (before main() starts). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10726 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-28Changed the fonts used for the FL_COURIER font family on the Mac.Manolo Gouy
It used to be 'Courier New' that was judged too thin. 'Courier' will be used now. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10722 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-15Replaced incorrect use of abs() with floating point argument by fabs().Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10707 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-06-14Fixed problem of upside-down text when compiling with SDK OS X 10.4Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10193 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-10-29Fix mac-specific STR#2999. Use PostScript font name to ask the system for a ↵Manolo Gouy
font, and full font name to display a font name. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10011 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-10-03OSX: transferred from 3.0 the great speed improvement of text width ↵Manolo Gouy
computation when many substitute fonts are involved. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9120 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-07-19Modifications to all LGPL headers for STR #2685.Greg Ercolano
(to clarify static exception LGPL by changing license references) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8864 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-04-17I've extended Manolo's excellent tweaks that handle surrogate pairs.Ian MacArthur
I found some kind of weird interaction with some symbol fonts that covered the supplementary planes that meant we could not measure the width correctly (although we did measure the text extents correctly.) This mod mirrors what we do for non-surrogate-pair glyphs more closely and appears to do the Righ Thing now, at least for the test fonts that I have, and which were exhibiting the aberrant behaviour before. I don't think I have broken anything else in the meantime! git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8597 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-04-17Made Fl_Quartz_Graphics_Driver::text_extents() resistant to mal-formed UTF-8 ↵Manolo Gouy
text. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8596 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-04-07Modified Fl_Quartz_Graphics_Driver::width(unsigned int wc) so it handles ↵Manolo Gouy
properly cases with wc > 0xFFFF. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8569 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-04-04Fix error that can happen with some 3rd party fonts lacking certain size ↵Manolo Gouy
information. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8558 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-03-04Mac OS: modified the definition of the fl_mac_os_version global variable to ↵Manolo Gouy
allow v 10.10.10 git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8504 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-03-01STR 2580: Fl::add_fd() now calls fl_open_display() because that is necessary ↵Manolo Gouy
for the fd event to be recovered by the event loop. Before main() is called, only fl_mac_os_version is initialized. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8488 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-21Removed inadequate use of fl_color() function.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8459 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-21Better horizontal positioning of right-to-left text.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8458 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-18Added virtual width(), height(), descent() and text_extents() functions to ↵Manolo Gouy
the Fl_Graphics_Driver class to prepare for the future definition of graphics drivers that fully deal with text measurement. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8442 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-16Improved calculation of text width and height when using the PostScript ↵Manolo Gouy
graphics context under Mac OS and MSWindows. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8438 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-08Fix STR #2558: use more consistently FL_NORMAL_SIZE to define the default ↵Manolo Gouy
font size of interface elements. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8405 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-07Replaced global variable fl_fontsize by fl_graphics_driver->font_descriptor().Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8395 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-05Removed global variables fl_font_ and fl_size_ that are now distinct for ↵Manolo Gouy
each graphics device. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8374 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-29Fix STR #2549: error in sizeof arithmeticManolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8331 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-28Removed compilation warning for pre-10.5 Mac OS.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8326 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-27Allow easier modification of the block size for character widths.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8319 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-25Stupid bug removedMatthias Melcher
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8315 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-25Added Fl::event_dispatch() which can add a function to FLTK that monitors ↵Matthias Melcher
all events before they reach Fl::handle(). STR 2532 git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8314 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-24Fix STR #2530 (Mac OS only)-continued. Change to allow display of the ↵Manolo Gouy
surrogate zone of UniChar. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8311 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-24Fix STR #2530 (Mac OS only)-continued. Use 512 blocks of 128 character ↵Manolo Gouy
widths-continued: two 256->512 substitutions were missing. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8310 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-24Fix STR #2530 (Mac OS only)-continued. Use 512 blocks of 128 character widthsManolo Gouy
(instead of 256x256) because this reduces greatly the opening time of windows with several new fonts. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8309 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-24Fix STR #2530 (Mac OS only). Implements a fast algorithm for fl_width() that ↵Manolo Gouy
memorizes the width of all characters the first time they are seen and computes the width of a string as the sum of the widths of its characters. Char widths are memorized in 256 blocks of 256 widths; only blocks used in some text are allocated and computed. The width of characters beyond U+FFFF is computed anew each time. Strings are drawn using core text, after having deactivated character kerning, so their width is the sum of the widths of their characters. This is the same algorithm as used for WIN32. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8305 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-21Removed duplicate definition of font_mx variable.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8296 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-16Fix STR #2525. The bug was PPC-specific.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8283 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-12-28Use device abstraction for font and text drawing.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8126 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-12-27Removed useless statements.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8120 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-11-29More copyright 2010 mods.Greg Ercolano
Used: vi `grep -r 'Copyright .*Spitzak' . | grep -v 2010 | grep -v '/\.svn' | cut -d: -f1` git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7913 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-11-25Mac OS X: introduced global variable fl_mac_os_version and cleaned a few ↵Manolo Gouy
unused variables. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7892 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-11-17Removed compilation warnings when compiling before 10.5 (STR 2428)Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7868 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-11-15Solves STR #2428: Silence float->int conversion warningsGreg Ercolano
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7836 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-07-01Renamed global variable from fl_device to fl_graphics_driver to better ↵Manolo Gouy
express its class git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7659 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-06-24Mac OS X: fixed bug where fl_draw(const char*, int, float, float) would not ↵Manolo Gouy
work on non-Quartz device git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7654 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-06-21Fix STR 2339 by defining new member function rtl_draw of class ↵Manolo Gouy
Fl_Graphics_Driver git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7652 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-05-27Better device hierarchy with surfaces and graphics drivers.Manolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7617 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-03-29Removed more Cocoa/Quartz references. Finally moved OS X font down a pixel.Matthias Melcher
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7357 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-03-29OS X: removed all Carbon and Quickdraw references. Starting with 1.3, we ↵Matthias Melcher
only support Cocoa and Quartz. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7351 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-03-14Merge of branch-1.3-Fl_Printer, with the following main changes:Albrecht Schlosser
(1) adding Fl_Device class (and more) for device abstraction (2) adding Fl_Pinter class (and more) for printing support. Todo: Code cleanup, update dependencies, remove/replace test print window. I'm looking into converting the test window popup in a global shortcut that would pop up the print dialog now... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7263 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-02-25Working VisualC suport in IDE's (dll's are still missing). Fixed a few warnings.Matthias Melcher
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7147 ea41ed52-d2ee-0310-a9c1-e6b18d33e121