|
Last change
on this file was
15258,
checked in by westram, 9 years ago
|
- AW_font_limits
- adds was_notified(); use as assertion
- default ctor: initializer list
- used by reset() (was: vice versa)
- (assert) combining ctor works for default-constructed instances
- bugfix: min_width was invalid for AW_GC::get_font_limits(char c)
- AW_font_group
- use another instance of AW_font_limits (instead of single variables) ⇒ default ctor works correct
- unregisterAll() just reinitializes this
- renames
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
|
File size:
1.7 KB
|
| Line | |
|---|
| 1 | // ==================================================================== // |
|---|
| 2 | // // |
|---|
| 3 | // File : AW_font_group.cxx // |
|---|
| 4 | // Purpose : Bundles a group of fonts and provides overall maximas // |
|---|
| 5 | // // |
|---|
| 6 | // // |
|---|
| 7 | // Coded by Ralf Westram (coder@reallysoft.de) in December 2004 // |
|---|
| 8 | // Copyright Department of Microbiology (Technical University Munich) // |
|---|
| 9 | // // |
|---|
| 10 | // Visit our web site at: http://www.arb-home.de/ // |
|---|
| 11 | // // |
|---|
| 12 | // ==================================================================== // |
|---|
| 13 | |
|---|
| 14 | #include "aw_font_group.hxx" |
|---|
| 15 | #include "aw_common.hxx" |
|---|
| 16 | |
|---|
| 17 | void AW_font_group::registerFont(AW_device *device, int gc, const char *chars) { |
|---|
| 18 | aw_assert(gc <= AW_FONT_GROUP_MAX_GC); |
|---|
| 19 | |
|---|
| 20 | aw_assert(!font_registered(gc)); // font for gc is already registered |
|---|
| 21 | |
|---|
| 22 | const AW_GC *gcm = device->get_common()->map_gc(gc); |
|---|
| 23 | |
|---|
| 24 | if (!chars) { // use complete ASCII-range for limits |
|---|
| 25 | gc_limits[gc] = gcm->get_font_limits(); |
|---|
| 26 | } |
|---|
| 27 | else { |
|---|
| 28 | aw_assert(chars[0]); |
|---|
| 29 | AW_font_limits limits; |
|---|
| 30 | for (int i = 0; chars[i]; ++i) { |
|---|
| 31 | limits = AW_font_limits(limits, gcm->get_font_limits(chars[i])); |
|---|
| 32 | } |
|---|
| 33 | gc_limits[gc] = limits; |
|---|
| 34 | } |
|---|
| 35 | aw_assert(font_registered(gc)); |
|---|
| 36 | |
|---|
| 37 | any_limits = AW_font_limits(any_limits, gc_limits[gc]); |
|---|
| 38 | aw_assert(any_font_registered()); |
|---|
| 39 | } |
|---|
| 40 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.