History log of /haiku/headers/os/interface/Font.h
Revision Date Author Comments
# a31ade72 01-Mar-2024 Máximo Castañeda <antiswen@yahoo.es>

BFont: remove default values from ambiguous method

Noticed by Joachim Mairböck after I hastily merged change 7402.

Also add named variation instance selection for fonts loaded from memory
areas like there already is for files.

Change-Id: I76de22181dc39559956c25987165be2f8a8c4a37
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7493
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# d0f06357 14-Feb-2024 Jérôme Duval <jerome.duval@gmail.com>

app_server FontManager: load all fonts and named-variants from a file

BFont::LoadFont can now use an index (0-based) and an optional named-instance (1-based)
to select the font variant from a file.
BFont::LoadFont can also use an index when loading from memory.

Change-Id: I0ce3eb6cc77d32cf43847416561eafe3063ca693
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7402
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Máximo Castañeda <antiswen@yahoo.es>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 4f52a155 16-Jan-2023 Dale Cieslak <dcieslak@yahoo.com>

BFont: Minor code cleanup and autolocking for AppFontManager

* changed explicit locking to use Autolocker for gFontManager/fAppFontManager
in ServerApp, per comments in https://review.haiku-os.org/c/haiku/+/4790
* changed BFont::LoadFont (memory version) to use size_t for size and offset
* no functional changes

Change-Id: I438a4975d5bb1b2fa17bc54e9e171c31dadfeec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6003
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 85b82f85 19-Jul-2022 Dale Cieslak <dcieslak@yahoo.com>

BFont: allow loading of user fonts from disk or memory

This patch adds an API call to BFont, called LoadFont, that
takes a string path to a font file. The user fonts are managed
via a new class called AppFontManager that inherits from the base
class FontManagerBase but adds the methods to add and remove user
fonts from disk or memory. There is also a new method called UnloadFont
to remove a user font, but on exit of an app all user fonts should be
automatically cleaned up.

Global/system fonts are managed by the GlobalFontManager, which is
a new class that also inherits from the base class FontManagerBase,
replacing the old "FontManager" class.

A maximum of 128 user fonts may be loaded, and memory fonts
may not exceed 20MB.

There's also an overloaded version of LoadFont that accepts
an area_id and loads the font from memory. A size and offset may
optionally be provided to allow for an area that contains more
than just a font.

Change-Id: I6add42bdf0c0cefc0e2e2a4984fd848c3e7269e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4790
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 9b6b158b 10-Mar-2016 dsizzle <dcieslak@yahoo.com>

Implementation of BFont::Blocks

BFont::Blocks is now implemented in ServerFont, via a call through the
app_server. It uses fontconfig to iterate through a charset of a font
and stores the defined blocks in a bitmap.

A new API was added, BFont::IncludesBlock, that will allow for arbitrary
testing of a given Unicode block. Since nothing is cached, searching
through an entire charset for a series of Unicode blocks can be quite
slow. In a given block there may be only 1 or 2 characters actually
defined so every character within a block needs to be checked until one
is found, which in a degenerate case will mean the entire block is
checked.

Signed-off-by: Axel Dörfler <axeld@pinc-software.de>


# 95fdee0b 21-Jan-2015 Axel Dörfler <axeld@pinc-software.de>

BStringView: added truncation support.

* Added new truncation mode B_NO_TRUNCATION.
* The Truncation()/SetTruncation() methods itself are Dano-compatible,
however, there was no B_NO_TRUNCATION.


# 75dde2cf 15-Jan-2013 John Scipione <jscipione@gmail.com>

Fix some pedantic style issues in Font.h


# 89208c77 27-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

Finished unifying the Interface Kit headers:
* Fixed copyrights (puncuation and capitalization, removed authors from
headers)
* Updated indentation style
* Unified pointer/reference style
* Re-ordered some methods for better grouping where it could be done
(abd adopted source accordingly)
* Small coding style fixes here and there

No functional change intended.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32745 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 97e88fa4 26-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

Indentation cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32691 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5b30a26b 24-May-2008 Stephan Aßmus <superstippi@gmx.de>

Added additional font face flags for "condensed", "light" and "heavy".
Our font has some extra styles and these could be picked up as the
"regular" face by accident, as witnessed by Firefox. Tracked down by
Michael Lotz. Firefox uses the correct font now for it's interface.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25636 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f6e4cbb9 15-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2222864e 02-Aug-2007 Stephan Aßmus <superstippi@gmx.de>

* complete overhaul of the font/glyph caching
* the previous AGG implementation is superfluous
* the new implementation is based on that one, but in a way that allows
read/write locking to the list of cache entries (fonts) as well as
read/write locking to the cached glyphs per individual font cache entry
* new GlyphLayoutEngine.h, which is to be the central place for layouting
glyphs along the baseline.
It handles the locking for getting the font cache entries.
It works by giving it a template class GlyphConsumer which does the
actual work.
* changed AGGTextRenderer to use the new font cache
* changed ServerFont::StringWidth(), and the bounding box stuff to use it
* changed DrawingEngine, it doesn't need the global font lock anymore
* our BFont thought that GetBoundingBoxesAsGlyphs and GetBoundingBoxesAsString
is the same, which of course it isn't, hence the two separate functions...
AsGlyphs just gets the bounding box of each glyph in a string, not treating
the string as an actual word
AsString adds the offset of the glyph in the word to the bounding box
* changed ServerProtocol.h accordingly for the different bounding box meaning


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21797 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 10f6ed94 17-Dec-2006 Stephan Aßmus <superstippi@gmx.de>

* implemented "false bold" for text rendering. It is a new property
of BFont. You can BFont::SetFalseBoldWidth(float) a width on a
BFont object, and it will cause the glyph shapes to be run through
an AGG "contour converter" so that they become thicker or thinner.
IIRC, this is commonly referred to as "false bold". The "width" value
is the distance in pixels that the new glyph outline will be offset
from the original outline.

It would be nice if someone could look at my change to View.h with
regards to the B_FONT_ALL flag.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19547 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 42b5ae7d 07-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

BFont::_GetExtraFlags() no longer returns a status value, but fills in default
values in case the server communication failed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14742 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b2cc3454 07-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

More font work:
* Simplified server communication a bit: instead of separate queries for font
direction, "is fixed", ... there is now a private extra flags field that is
filled on demand.
* The server command names now describe what the command does, and are not simply
named after the BFont method (AS_SET_FAMILY_AND_STYLE vs. AS_GET_FAMILY_AND_STYLE_IDS).
* Replaced B_SET_SYSFONT_{PLAIN|BOLD|FIXED} with a single B_GET_SYSTEM_FONTS.
* Rewrote Font.h and added our license.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14741 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 297cd250 01-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Followed Marcus' suggestion and made fHeight mutable - not nice, but cleaner
than casting away the const.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14614 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 04ab15f9 15-Jan-2005 DarkWyrm <darkwyrm@gmail.com>

Gave _font_control() friend status so we can init the system fonts


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10765 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ec5fd24 28-Feb-2003 DarkWyrm <darkwyrm@gmail.com>

Finally got around to removing the BFont memory leak


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2854 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5f511927 10-Dec-2002 beveloper <beveloper@nowhere.fake>

removed /* within comment


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2222 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 63db78ca 06-Nov-2002 beveloper <beveloper@nowhere.fake>

fix header guards to fix app server build problems


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1866 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3bb5ee98 23-Oct-2002 beveloper <beveloper@nowhere.fake>

BFont doesn't have a destructor


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1629 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 04b68691 12-Oct-2002 DarkWyrm <darkwyrm@gmail.com>

Initial checkin


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1494 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 95fdee0bc0ac24d9df13391dd8332fcee64dc94c 21-Jan-2015 Axel Dörfler <axeld@pinc-software.de>

BStringView: added truncation support.

* Added new truncation mode B_NO_TRUNCATION.
* The Truncation()/SetTruncation() methods itself are Dano-compatible,
however, there was no B_NO_TRUNCATION.


# 75dde2cf73c05c494b166a1730750a011e236016 15-Jan-2013 John Scipione <jscipione@gmail.com>

Fix some pedantic style issues in Font.h


# 89208c77f10235d43fda0c7b3fd6751db02cc12c 27-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

Finished unifying the Interface Kit headers:
* Fixed copyrights (puncuation and capitalization, removed authors from
headers)
* Updated indentation style
* Unified pointer/reference style
* Re-ordered some methods for better grouping where it could be done
(abd adopted source accordingly)
* Small coding style fixes here and there

No functional change intended.

+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32745 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 97e88fa432d32099b7132f469709f71b9eaf8cbb 26-Aug-2009 Stephan Aßmus <superstippi@gmx.de>

Indentation cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32691 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5b30a26b7ced440833fc4f0369c4ee8d717af99c 24-May-2008 Stephan Aßmus <superstippi@gmx.de>

Added additional font face flags for "condensed", "light" and "heavy".
Our font has some extra styles and these could be picked up as the
"regular" face by accident, as witnessed by Firefox. Tracked down by
Michael Lotz. Firefox uses the correct font now for it's interface.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25636 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f6e4cbb95290a74b33d012600438b84742b0e572 15-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2222864eed6bc28cff3d837c98d1509dcbcf38bc 02-Aug-2007 Stephan Aßmus <superstippi@gmx.de>

* complete overhaul of the font/glyph caching
* the previous AGG implementation is superfluous
* the new implementation is based on that one, but in a way that allows
read/write locking to the list of cache entries (fonts) as well as
read/write locking to the cached glyphs per individual font cache entry
* new GlyphLayoutEngine.h, which is to be the central place for layouting
glyphs along the baseline.
It handles the locking for getting the font cache entries.
It works by giving it a template class GlyphConsumer which does the
actual work.
* changed AGGTextRenderer to use the new font cache
* changed ServerFont::StringWidth(), and the bounding box stuff to use it
* changed DrawingEngine, it doesn't need the global font lock anymore
* our BFont thought that GetBoundingBoxesAsGlyphs and GetBoundingBoxesAsString
is the same, which of course it isn't, hence the two separate functions...
AsGlyphs just gets the bounding box of each glyph in a string, not treating
the string as an actual word
AsString adds the offset of the glyph in the word to the bounding box
* changed ServerProtocol.h accordingly for the different bounding box meaning


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21797 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 10f6ed940bffa4153ff5511897bcc823b1f2d792 17-Dec-2006 Stephan Aßmus <superstippi@gmx.de>

* implemented "false bold" for text rendering. It is a new property
of BFont. You can BFont::SetFalseBoldWidth(float) a width on a
BFont object, and it will cause the glyph shapes to be run through
an AGG "contour converter" so that they become thicker or thinner.
IIRC, this is commonly referred to as "false bold". The "width" value
is the distance in pixels that the new glyph outline will be offset
from the original outline.

It would be nice if someone could look at my change to View.h with
regards to the B_FONT_ALL flag.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19547 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 42b5ae7db9ba5a8e96a96a016d494bc399921640 07-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

BFont::_GetExtraFlags() no longer returns a status value, but fills in default
values in case the server communication failed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14742 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b2cc345461400d6944e2de35ec6decc8d1af8751 07-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

More font work:
* Simplified server communication a bit: instead of separate queries for font
direction, "is fixed", ... there is now a private extra flags field that is
filled on demand.
* The server command names now describe what the command does, and are not simply
named after the BFont method (AS_SET_FAMILY_AND_STYLE vs. AS_GET_FAMILY_AND_STYLE_IDS).
* Replaced B_SET_SYSFONT_{PLAIN|BOLD|FIXED} with a single B_GET_SYSTEM_FONTS.
* Rewrote Font.h and added our license.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14741 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 297cd250fa5ae719b821d0a3814f2e688296f29b 01-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Followed Marcus' suggestion and made fHeight mutable - not nice, but cleaner
than casting away the const.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14614 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 04ab15f96d48d44ac16b749f2dc37e6474a91ca4 15-Jan-2005 DarkWyrm <darkwyrm@gmail.com>

Gave _font_control() friend status so we can init the system fonts


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10765 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ec5fd245a420532a566e09b4d8cc5ea46312165 28-Feb-2003 DarkWyrm <darkwyrm@gmail.com>

Finally got around to removing the BFont memory leak


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2854 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5f511927a9a53bad6fdecd9136c56de54cf2befd 10-Dec-2002 beveloper <beveloper@nowhere.fake>

removed /* within comment


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2222 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 63db78ca7dbccbb116708d6bbc38250154bbe665 06-Nov-2002 beveloper <beveloper@nowhere.fake>

fix header guards to fix app server build problems


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1866 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3bb5ee98f7a786bba16ea2f0b24c0351ba39ff80 23-Oct-2002 beveloper <beveloper@nowhere.fake>

BFont doesn't have a destructor


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1629 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 04b68691762cc66552dc96e4a5cd848f607b254b 12-Oct-2002 DarkWyrm <darkwyrm@gmail.com>

Initial checkin


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1494 a95241bf-73f2-0310-859d-f6bbb57e9c96