public interface FontFactory
Font
s upon request. Implementations must be Thread-safe and prepared to
handle lots of calls from various Threads concurrently.
Implementation note: Since instances are often used in time-critical environments, implementations must be quick to return an applicable font. For example, the FontFactory used for loading and displaying documents must be quick to respond. Otherwise users might perceive document display to be slow. Depending on specific documents in use, there are also cases where the FontFactory will be called oftentimes, even with identical parameters.
Modifier and Type | Method and Description |
---|---|
Font |
create(FontAttributeSet fontAttributeSet,
Map<String,Object> scope)
Supply a
Font which fits well for the requested parameters. |
Font create(FontAttributeSet fontAttributeSet, Map<String,Object> scope)
Font
which fits well for the requested parameters. Care should be taken to
provide a fast implementation. This method might be called frequently and from various Threads at
the same time. Blocking should be avoided.fontAttributeSet
- The Attribute
s the requested font should have. Characteristics
like its name or styles.scope
- Information about this request's scope. This could encompass things like its intent,
target, purpose or source.Font
deemed appropriate, or null
if no such Font
is
available. Some implementations might be able to return a Font
which fits all
requested characteristics. Others might have several to choose from or none at all. The
Font
which is returned doesn't have to fit all of the requested characteristics,
or even any at all. It must only be appropriate in the given situation.Scopes
Copyright © 2024 levigo holding gmbh. All rights reserved.