class Blob
Blobs wrap a chunk of binary data to handle lifecycle management of data while it is passed between client and HarfBuzz. Blobs are primarily used to create font faces, but also to access font face tables, as well as pass around other binary data.
Wraps hb_blob_t
.
Reference:
- Corresponding C source code: luaharfbuzz.h#L12
- HarfBuzz online documentation: hb_blob_t
methods
Blob.new
function Blob.new(data: string) -> Blob {
new = function,
new_from_file = function,
get_length = function,
get_data = function,
}
data
- A Lua string containing binary or character data.
Create a new "blob" object wrapping data.
Wraps hb_blob_create
.
Reference:
- Corresponding C source code: blob.c#L3-L14
- HarfBuzz online documentation: hb_blob_create
Blob.new_from_file
function Blob.new_from_file(filename: string) -> Blob {
new = function,
new_from_file = function,
get_length = function,
get_data = function,
}
filename
- lua string.
Create a new blob containing the data from the specified binary font file.
Wraps hb_blob_create_from_file
.
Reference:
- Corresponding C source code: blob.c#L16-L26
- HarfBuzz online documentation: hb_blob_create_from_file
Blob.get_length
Fetch the length of a blob's data.
Wraps hb_blob_get_length
.
Reference:
- Corresponding C source code: blob.c#L28-L33
- HarfBuzz online documentation: hb_blob_get_length
Blob.get_data
@return data
- the byte data of blob as a string
😱 Types incomplete or incorrect? 🙏 Please contribute!
Fetch the data from a blob.
Wraps hb_blob_get_data
.
Reference:
- Corresponding C source code: blob.c#L35-L44
- HarfBuzz online documentation: hb_blob_get_data