Commit Graph

46 Commits

Author SHA1 Message Date
Ian MacArthur
865f3d8e61 STR 2076: experimental fl_text_extents patch applied. Please feedback comments.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6529 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-11-19 20:34:27 +00:00
Fabien Costantini
92051890f1 Quickdraw removal: option removed from configure, all Qd code removed from sources. Also took this opportunity to sort the ifdef clauses so that USE_X11 shows first. Also added error pragma to enforce proper target checking, thus make even less assumptions.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6423 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-10-13 23:10:43 +00:00
Fabien Costantini
aca18384b7 STR#2058 fix: fl_draw() would crash on Quartz if no font was selected yet.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6388 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-10-06 16:40:42 +00:00
Fabien Costantini
cccbaca0c5 fixed max os x QD mode would not compile. Got back all the QD font drawing code from 1.1.9. the labels draw but are uncorrectly shifted to the right.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6357 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-09-30 18:06:44 +00:00
Matthias Melcher
b6bde2e456 Merging the UTF8 patch, consisting of O'ksi'd s original 1.1.6 patch and additions by Ian. PLEASE BE AWARE that the patch in its current incarnation is a regression in many aspects and further work is required before we can announce Unicode support.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6212 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-09-10 23:56:49 +00:00
Matthias Melcher
b6b746cd69 Replaced badly named type Fl_FontSize with Fl_Font_Descriptor. This type is only used in the core files and not available to the user.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6162 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-08-15 21:18:27 +00:00
Matthias Melcher
e63c50b2d1 Rename type Fl_Font_Size into Fl_Fontsize to comply with other naming in FLTK.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6161 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-08-15 21:11:21 +00:00
Matthias Melcher
7c8f5cc888 First attempt at consistently using Fl_Font as a type for the font index and Fl_Font_Size as a type to measure font height (or rather size).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6113 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-04-23 19:09:28 +00:00
Matthias Melcher
eef6353369 Fixed calculation of character widths for OS X Quartz rendering. Fixed OS X mouse click handling (STR #1504).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5651 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2007-02-01 20:13:57 +00:00
Matthias Melcher
8c94b01142 Added code to clear the current font cache when the font face is changed. Now for OS X and X11 as well.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5421 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2006-09-05 11:26:41 +00:00
Matthias Melcher
46a890cad3 Fixed typo in 'desktop-osx' install. Commented out unused variable.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5384 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2006-08-30 10:01:35 +00:00
Matthias Melcher
dadcbb61b3 Moved Quartz OS X fonts half a pixel up.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5335 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2006-08-19 19:20:56 +00:00
Matthias Melcher
86e2fa621a Fixed speed issues with measuring text sizes in OS X Quartz
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5334 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2006-08-19 15:24:55 +00:00
Matthias Melcher
aa9148eea8 Added check for NULL for numbnuts (like me) who query the size of a font before choosing a font... .
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5179 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2006-06-06 15:28:20 +00:00
Matthias Melcher
c80ca69407 OS X Quartz: fixed the text width problem.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5175 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2006-06-05 09:04:23 +00:00
Matthias Melcher
8130f16538 OS X Quartz rendering: text is now clipped and drawn in the correct color. I had to reverse the 'selection color' change because some widgets rely on this color being dark. Still problems with Fluid rendering and measuring fonts before a window is open.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5174 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2006-06-05 09:01:29 +00:00
Matthias Melcher
60ece00315 OS X Quartz: one pretty essential fix to the call order in Quartz context change which fixed a lot of warnings. I also added a file that helps tremondously to debug Core Graphics calls. This file is not compiled into the source tree by default, but the annotations in "src/cgdebug.h" explain the usage.
In regard to CG Text drawing vs. the new ATSU Text drawing: I now remember why I did not ATSU in the beginning: STDU does not use the CG clipping area or text pen settings. So, if you plan on using the current SVN with --enable-quartz, please be aware that you will not have any text clipping or any other text color than black.

Finally, I added code to FLTK on OS X that retreives the selection color from the system instead of assuming dark blue. I am not entirely confident about this change as it may require OS X 10.4 . Feedback appreciiated.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5173 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2006-06-04 10:21:45 +00:00
Matthias Melcher
c4b8afdcf9 STR #1305: Added MacRoman to utf16 lookup table. Everything's rendered the way we are used to it now, only in Quartz.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5172 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2006-06-02 15:01:32 +00:00
Matthias Melcher
4dd1f5e216 STR #1305: partial fix.
FLTK on Mac with --enable-quartz now uses ATSU instead of CG to render text. First of all, it is a lot faster, but more importantly, character positions are now all at integer positions. This is not as beatiful as standard Mac text, but required by the FLTK internals. I seriously doubt that anyone who's not a typesette will notice the difference.

But - and there's always a but, isn't there?

This commit does not handle the ASCII-to-UTF16 conversion yet, so all characters above 127 are junk.

Also, there are still a lot of problems with the Quartz support in general. Most prominently, we still get a lot of messages about invalid contexts which ruins the clipping.

So in conclusion (this must be the longest SVN commit annotation ever) this modification fixes the main reason why I did not finish the Quartz port. After fixing this, there's hope that we will wrap even that dirty little corner of FLTK up for good!



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5171 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2006-06-02 14:17:41 +00:00
Matthias Melcher
c9908d97e3 THIS FIX CONTAINS TWO MORE FILES THAT MUST BE COMPILED. I would
like to ask the maintainers of the build environments to please
add these files to the setup:

  src/fl_encoding_latin1.cxx
  src/fl_encoding_mac_roman.cxx

I ADDED SOME DOCUMENTATION THAT NEEDS TO BE FIXED. Beeing not a
native English speaker, I have a hard time writing documentation.
Would someone please update my babbeling in 
documentation/drawing.html? Thanks.

This commit fixes some very basic problems with OS X's code page in
preparation for the compose-character keyboard fix. It also fixes
issues with MS Windows and X11 not rendering the characters
in the Western (Latin-1) set between 0x80 and 0x9F. In the original
ISO font, they were unused, but are now assigned to international
characters like the Euro currency sign.

This patch also tries to fix one basic flaw with FLTK 1 and
font encoding. I will not put much more work into this because
FLTK 1.2 and FLTK 2 fix the problem entirely by using UTF-8
instead of 8-bit "C"-style strings.

All these changes are only meaningful for foreign language
users or users of special characters like the Euro, the Degree
or the Permille symbol. A short explanation follows.

Max OS X uses a different code page than X11 and Win32. This means
that all characters above 0x7f have an entirely different meaning.
If your source code contains international characters, your 
text will appear different if you change to another OS. This patch
provides two functions that convert text with international
characters from the character set of the source code into the
local character set. Two more functions are provided to convert
them back. The functions are fl_latin1_to_local (source is in Win32 
or X11), fl_mac_roman_to_local (source was written on OS X) and the 
corresponding fl_local_to_latin1 and fl_local_to_mac_roman, which
are very useful if yoou want to store strings with intl. characters
that will be moved between systems.

All this is assuming a "Western" code page as it is common in
the Americas and most of Europe. User of other languages will have 
to use FLTK 2.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4975 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2006-04-18 13:07:42 +00:00
Matthias Melcher
8209fcc6a3 STR #1044 (Mac only): The font number 12 and 15, usually assigned to
the fonts 'Symbol' and 'Webdings', are not translated from ISO to
MacRoman anymore. This fixes the problem of not having the correct
bullet in the Fl_Help Widget.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4587 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2005-10-09 16:27:45 +00:00
Michael R Sweet
1c399af444 Update source file headers with STR web page.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4288 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2005-04-16 00:13:17 +00:00
Michael R Sweet
add37faa25 Copyright updates.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4052 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2005-02-24 21:55:12 +00:00
Michael R Sweet
12993c9e43 Fix QuickDraw code typo.
Fix fl_width() for QuickDraw (now uses MacRoman encoded text...)


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3823 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-09-13 00:30:08 +00:00
Matthias Melcher
e20773fa57 Quartz port:
- removed all #warning statemnets and explained caveats with regular
  // warning lines
- made GL text rendering work again (may use wrong fonts since agl doesn't
  really support ATS)
- removed horizontal jittering in Fl_Input_ caused by fractional text
  positions. Unfortunatly, this does not work for Fl_Text_Display, which
  not only jitters, but also became horendously slow due to the complex
  font rendering in Quartz)

I will fix some of the speed issues in fl_measure this afternoon, and
also improve on the 'innards' for rgb data rendering. After that, I will
have to leave the Quartz port alone for a while due to lack of time.
I suggest we make another rc in the next days.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3812 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-09-09 21:34:48 +00:00
Matthias Melcher
b90f593ae6 News from FLTK1.1 and Quartz
- listing fonts using ATS instead of QD
- made bold and italic fonts work
- returning correct font metrics
One problem came up though: Quartz renders fonts at subpixel positions,
which is great for the overall look, but unfortunatly 'fl_draw' supports
only integer coordinates for printing. As a result, marking a line of text
makes the rest of the line jump by a fractional pixel. Any suggestions to
solve this problem are greatly appreciated!


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3810 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-09-09 00:55:41 +00:00
Michael R Sweet
a8b58dc223 Documentation updates (STR #505, STR #513)
The old source file "fl_set_gray.cxx" is not needed (STR #516)

Fl_Text_Display still called delete[] instead of free() in one
place (STR #503)

Fl_File_Chooser didn't correctly call isprint() and isspace()
when checking to see if the current file was text that can be
previewed (STR #517)

FLUID didn't compile with Borland C++ due to a compiler bug (STR
#496)

Fl_Positioner did not handle reversed min and max values (STR
#510)

fl_descent(), fl_height(), and fl_width() would crash a program
if you didn't call fl_font() first; they now return -1 if no
font is set (STR #500)


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3805 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-09-07 20:59:18 +00:00
Matthias Melcher
bc704ad62f Quartz:
- made multiple contexts for windows, popups and menus work
- still missing: double buffer handling


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3793 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-08-27 20:02:45 +00:00
Matthias Melcher
329f84671e Mac Quartz:
- attempt at making the clipping work well
- improved drawing (still many 1-off bugs)
- 'arc' test seems to run well
- beware! the Quartz version is pretty unstable at this point


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3785 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-08-26 06:18:12 +00:00
Matthias Melcher
25fe8425db Quartz implementation for FLTK 1.1:
- added very crude font support
- added line drawing support
- added line color support
- added filled shapes support
- added some arc and circle support (no ovals)
- attempt at getting the clipping working, however the stack oriented
  design of Quartz is starting to become a real hassle


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3784 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-08-26 00:18:43 +00:00
Matthias Melcher
8327822026 Updated config stuff to allow for --enable-quartz ofr Mac OS X which in
turn defined USE_QUARTZ to 1 and defines __APPLE_QUARTZ__. If Quartz
is not disabled, it will define __APPLE_QD__ for Quickdraw.

I also replaced all relevand #ifdef __APPLE__ with #ifdef __APPLE_QD__
#elif defined(__APPLE_QUARTZ__). This does not affect the compile at
this time and both version will generate the same Quickdraw code.

I will start to replace all QD calls with Quartz calls for the
remainder of the week until I can completely remove all QD calls from
the Quartz branch.

Thanks to Robert Smith for a great initial Quartz implementation.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3782 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-08-25 00:20:27 +00:00
Michael R Sweet
a3d0905c9e Copyright updates and prep for 1.1.5rc1.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3391 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2004-04-11 04:39:01 +00:00
Michael R Sweet
3aebbc01dc Remove "fix" for DND code; the original code works just fine (should have
tested first on OSX...)

Get rid of compiler warning in fl_draw...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3001 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2003-05-26 14:19:50 +00:00
Michael R Sweet
2549a4ad62 Map ISO-8859-1 to MacRoman encoding on OSX (temporary until 2.0's UTF-8
support...)


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2992 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2003-05-21 13:23:40 +00:00
Michael R Sweet
67af078c9c Fix fl_font/fl_size on MacOS X.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2968 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2003-04-06 12:54:57 +00:00
Michael R Sweet
00cb676e11 Copyright update for 1.1.3 release (not quite yet, but soon...)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2936 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2003-01-30 21:46:07 +00:00
Matthias Melcher
a4e0a9adb5 Added Greg Ercolanos filedescripter support
Fixed Text Width bug.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2325 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-06-27 23:18:12 +00:00
Matthias Melcher
9c29ecde90 MacOS:
Pixmap Draw fix: pixmap would always draw from 0, 0
gl_font implemented
FL_FOCUS fix: would not send FL_FOCUS when window activated
window classes fixed: modal() and non_modal() should work much better
glut fix: uninitialised 'display' callback made glpuzzle crash

Please send bug reports


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2323 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-06-27 04:29:39 +00:00
Michael R Sweet
d769df9a59 D'oh! Never set fl_font_ and fl_size_ in new mac code...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2298 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-06-08 15:37:11 +00:00
Michael R Sweet
be16fa3027 Make sure fl_size_, fl_font_, and fl_xfont are initialized and used.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2297 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-06-08 13:07:19 +00:00
Michael R Sweet
a2cd4c80b1 Declare fl_size_ and fl_font_.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2294 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-06-07 19:55:44 +00:00
Michael R Sweet
e52b682a99 Add Xft support to 1.1.x.
TODO: Fl::set_fonts() should add all of the fonts returned by Xft;
right now it is a no-op.

BUG: Getting X messages like "XRequest.155: 202 0x260002b" for some
reason on my system.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1987 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-03-06 18:11:01 +00:00
Michael R Sweet
64b4177ef4 Copyright updates...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1903 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2002-01-01 15:11:33 +00:00
Matthias Melcher
0215c7986c fixed iBook keyboard bug.
all message handling now in Carbon.
mouse capture support added.
timer support added.
overlay support added.

getting there...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1881 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2001-12-20 05:27:14 +00:00
Matthias Melcher
1d06051e8c FLTK for Mac:
Reversed to outdated (but working) event handling.
 Added README.mac
 Added mac.r minimal resource fork
 Still lots of bugs, but initial rendering works


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1804 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2001-12-04 03:03:17 +00:00
Michael R Sweet
2b85bf8168 Preliminary commit of my MacOS X work.
**** THIS CODE COMPILES BUT DOES NOT WORK. ****

TODO: fix event handling - getting blank windows, etc.
TODO: re-port OpenGL code.
TODO: add support for images with alpha.
TODO: add support for more then just beeps in fl_beep().
TODO: other stuff I'm sure...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1765 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2001-11-27 17:44:08 +00:00