nw::font::PackedFont::LockSheet Member Function

Syntax

bool LockSheet(
     CharCode c
);

Arguments

Name Description
in c Character code indicating the glyph included on the sheet to be locked.

Return Values

Returns
true if locked or
false if the locking could not be performed.
Locking cannot be performed once the maximum number of lockable sheets has been exceeded.

Description

Prevents sheets in cache from being discarded.

With the PackedFont class, sheets are maintained in a compressed state and expanded and cached as needed by functions such as the nw::font::PackedFont::GetGlyph function. When there is insufficient cache available, the cache last used is discarded to free up cache.
By using this function, a sheet can be excluded from the discard targets even when cache becomes insufficient. Performance may be improved by locking sheets that contain characters that are used frequently, such as ASCII characters or Japanese hiragana.

The maximum number of sheets that can be locked is (number of caches - 1).

See Also

nw::font::PackedFont::GetNumCache
nw::font::PackedFont::UnlockSheet
nw::font::PackedFont::UnlockSheetAll

Revision History

2009/11/09
Initial version.

CONFIDENTIAL