History log of /haiku/src/servers/app/font/FontManager.h
Revision Date Author Comments
# 7866929c 18-Apr-2024 Máximo Castañeda <antiswen@yahoo.es>

app_server: make FontFamily referenceable

FontStyle will be keeping the references, so the family will exist as
long as there's a style pointing to it.

Change-Id: I639f7914be924a84d5db5882c638a4dac665aa23
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7634
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 0b850880 12-Apr-2024 Máximo Castañeda <antiswen@yahoo.es>

app_server: keep pinned fonts accessible by ID after removal

On font removal styles may still be referenced by views, pictures or
whatever else. In that case, what we were doing had the following
effects:
- The style is still available through the family. So it is still
returned when listing fonts.
- The style is not available by ID. So a few app server messages will
fail, including those for string width or character escapements.
Moreover, if the removal was due to an update, adding the style again
fails because we already have one by that name. If all the old
references are finally dropped, we end up without the old nor the
updated style.

We now do the opposite: until all references are dropped, a style can
still be fetched by ID (that is, by an object that loaded it before
being removed), but it is not listed anymore (so it won't be given to an
app loading a font by name or by changing the style of a font of the
same family).

Fixes: #18868
Change-Id: Ia64744afeb9297fd446e437d08636733b6dc0aec
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7633
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# f657c49d 01-Apr-2024 Máximo Castañeda <antiswen@yahoo.es>

app_server: font style 0 may not exist

In which case failure to find it in the styles hash table does not tell
us anything about the existence of its family.

Change-Id: I77c8960a96e7283547650daae67ea71fd022567e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7631
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# e70df3f7 14-Feb-2023 Máximo Castañeda <antiswen@yahoo.es>

app_server: AppFontManager does not need a BLooper

Saves at least a thread and a few semaphores per app.

Change-Id: Ied43e5944471918b34b897722346a25d159090df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6073
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 6ae6a38e 11-Feb-2023 Máximo Castañeda <antiswen@yahoo.es>

app_server: refactor font managers

Move common add/remove code to the base class and improve encapsulation.
Loading FreeType is the responsibility of the global font manager.
Rename FontManagerBase back to FontManager.

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


# cb190a7d 10-Feb-2023 Máximo Castañeda <antiswen@yahoo.es>

app_server: new font code cleanup: includes and the like

Change-Id: I4b7f882fffc34be1984060838f13971c48d4abfc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6059
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
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>


# 12ae5308 23-Jul-2022 John Scipione <jscipione@gmail.com>

App Server: Style fixes related to font updates

Reorder font defines to plain, fallback, bold, fallback, fixed, fallback.

Minor functional changes: No BeOS font fallbacks for Haiku apps.

Use FALLBACK_BOLD_FONT_STYLE instead of DEFAULT.

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


# d99d8dbd 27-Aug-2020 X512 <danger_mail@list.ru>

app_server memory management: use ObjectDeleter to mark ownership

Make object ownership explicit by use of ObjectDeleter where possible.

Change-Id: I499a00aa3390d1510ae284419e73faffa5166430
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2695
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# 60d30785 27-Aug-2020 X512 <danger_mail@list.ru>

app_server memory management fixes: use BReference

Use BReference for more automated reference counting in app_server,
fixing some use-after-free and other problems.

Extracted from https://review.haiku-os.org/c/haiku/+/2695

Change-Id: I141bb248229405896b29feff3338447f7257b0b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3175
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# d4dbce29 07-Mar-2020 Augustin Cavalier <waddlesplash@gmail.com>

app_server: Drop custom HashTable and use HashMap instead.

Change-Id: I7d5aae6a7fd2b4f47704a931a23eee09a4eedcac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2323
Reviewed-by: John Scipione <jscipione@gmail.com>


# f4f30311 24-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Cleanup app server directory a bit by creating a font and a decorator sub folder.



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


# f4f30311aab9b2768d3ef7e590f85598298edfe0 24-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Cleanup app server directory a bit by creating a font and a decorator sub folder.



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