harfbuzz-shape-features.dhover×396all
#!/usr/bin/env dub
/+ dub.sdl:
    name "font_libraries_harfbuzz_shape_features"
    targetPath "build"
    libs "harfbuzz"
    buildType "checked" {
        buildOptions "optimize" "inline" "debugInfo"
    }
+/
/**
 * HarfBuzz's whole object model in one program, pure D with hand-declared
 * `extern(C)` prototypes — no FreeType, no C shim, no struct of HarfBuzz's is
 * anything but plain data.
 *
 * Demonstrates, against a real font file:
 *
 *   1. The layering `hb_blob_t` → `hb_face_t` → `hb_font_t` → `hb_buffer_t`:
 *      bytes, then the immutable parsed face (`upem`, glyph count), then a
 *      face at a scale, then the mutable shaping buffer. Every object is
 *      reference-counted and opaque; the only structs that cross the boundary
 *      are the glyph info/position records and the feature/variation/axis
 *      descriptors.
 *   2. `hb_ot_layout_table_get_feature_tags` — the feature inventory an
 *      inspector lists (`GSUB` and `GPOS` separately).
 *   3. `hb_ot_var_get_axis_infos` — the `fvar` axes, and
 *      `hb_font_set_variations` setting one before shaping, so the advances a
 *      variable font reports move with the axis.
 *   4. `hb_shape` with an explicit `hb_feature_t[]`: the same string shaped with
 *      `calt`+`liga` forced on and forced off. On a programming font with
 *      contextual ligatures (Maple Mono, Fira Code) the glyph sequence differs;
 *      on a font without them it is identical — both are findings.
 *   5. Output units: `x_advance` is in font units scaled by `hb_font_set_scale`;
 *      here scale = upem so the numbers are design units.
 *
 * Companion to docs/research/font-libraries/harfbuzz.md § Analysis spine 1–4,
 * and the catalog's RQ3/RQ5 (variation flow; inspector inventory).
 *
 * Run with: dub run --single harfbuzz-shape-features.d [-- /path/to/font.ttf]
 *
 * Font resolution: the first argument if given, else `fc-match -f %{file}
 * monospace`. If neither yields a readable file (no fontconfig on the host,
 * e.g. macOS CI), prints a `SKIP:` line and exits 0 so CI stays green.
 */
module 
(module) font_libraries_harfbuzz_shape_features

HarfBuzz's whole object model in one program, pure D with hand-declared extern(C) prototypes — no FreeType, no C shim, no struct of HarfBuzz's is anything but plain data.

Demonstrates, against a real font file:

  1. The layering hb_blob_t → hb_face_t → hb_font_t → hb_buffer_t: bytes, then the immutable parsed face (upem, glyph count), then a face at a scale, then the mutable shaping buffer. Every object is reference-counted and opaque; the only structs that cross the boundary are the glyph info/position records and the feature/variation/axis descriptors.

  2. hb_ot_layout_table_get_feature_tags — the feature inventory an inspector lists (GSUB and GPOS separately).

  3. hb_ot_var_get_axis_infos — the fvar axes, and hb_font_set_variations setting one before shaping, so the advances a variable font reports move with the axis.

  4. hb_shape with an explicit hb_feature_t[]: the same string shaped with calt+liga forced on and forced off. On a programming font with contextual ligatures (Maple Mono, Fira Code) the glyph sequence differs; on a font without them it is identical — both are findings.

  5. Output units: x_advance is in font units scaled by hb_font_set_scale; here scale = upem so the numbers are design units.

Companion to docs/research/font-libraries/harfbuzz.md § Analysis spine 1–4, and the catalog's RQ3/RQ5 (variation flow; inspector inventory).

Run with: dub run --single harfbuzz-shape-features.d [-- /path/to/font.ttf]

Font resolution: the first argument if given, else fc-match -f %{file} monospace. If neither yields a readable file (no fontconfig on the host, e.g. macOS CI), prints a SKIP: line and exits 0 so CI stays green.

font_libraries_harfbuzz_shape_features
;
import
(package) std
std
.
(module) std.stdio
Category Symbols
File handles _popen File isFileHandle openNetwork stderr stdin stdout
Reading chunks lines readf readfln readln
Writing toFile write writef writefln writeln
Misc KeepTerminator LockType StdioException

Standard I/O functions that extend core.stdc.stdio. core.stdc.stdio is publically imported when importing std.stdio.

There are three layers of I/O:

  1. The lowest layer is the operating system layer. The two main schemes are Windows and Posix.

  2. C's stdio.h which unifies the two operating system schemes.

  3. std.stdio, this module, unifies the various stdio.h implementations into a high level package for D programs.

Source

std/stdio.d

@copyrightCopyright The D Language Foundation 2007-.@licenseBoost License 1.0.@authorsWalter Bright, Andrei Alexandrescu, Alex Rønne Petersen
stdio
:
(alias template) font_libraries_harfbuzz_shape_features.writeln = std.stdio.writeln(T...)(T args)

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
,
(alias template) font_libraries_harfbuzz_shape_features.writefln = std.stdio.writefln(alias fmt, A...)(A args) if (isSomeString!(typeof(fmt)))

Equivalent to writef(fmt, args, '\n').

writefln
;
import
(package) std
std
.
(module) std.string

String handling functions.

Category Functions
Searching
column
indexOf
indexOfAny
indexOfNeither
lastIndexOf
lastIndexOfAny
lastIndexOfNeither
Comparison
isNumeric
Mutation
capitalize
Pruning and Filling
center
chomp
chompPrefix
chop
detabber
detab
entab
entabber
leftJustify
outdent
rightJustify
strip
stripLeft
stripRight
wrap
Substitution
abbrev
soundex
soundexer
succ
tr
translate
Miscellaneous
assumeUTF
fromStringz
lineSplitter
representation
splitLines
toStringz
Objects of types string, wstring, and dstring are value types
and cannot be mutated element-by-element. For using mutation during building
strings, use char[], wchar[], or dchar[]. The xxxstring
types are preferable because they don't exhibit undesired aliasing, thus
making code more robust.

The following functions are publicly imported:

Module Functions
Publicly imported functions
std.algorithm
cmp, std,algorithm,comparison
count, std,algorithm,searching
endsWith, std,algorithm,searching
startsWith, std,algorithm,searching
std.array
join, std,array
replace, std,array
replaceInPlace, std,array
split, std,array
empty, std,array
std.format
format, std,format
sformat, std,format
std.uni
icmp, std,uni
toLower, std,uni
toLowerInPlace, std,uni
toUpper, std,uni
toUpperInPlace, std,uni
There is a rich set of functions for string handling defined in other modules.
Functions related to Unicode and ASCII are found in std.uni
and std.ascii, respectively. Other functions that have a
wider generality than just strings can be found in std.algorithm
and std.range.

Source

std/string.d

@seestd.algorithm and std.range for generic range algorithms , std.ascii for functions that work with ASCII strings , std.uni for functions that work with unicode strings@copyrightCopyright The D Language Foundation 2007-.@licenseBoost License 1.0.@authorsWalter Bright, Andrei Alexandrescu, Jonathan M Davis, and David L. 'SpottedTiger' Davis
string
:
(alias template) font_libraries_harfbuzz_shape_features.fromStringz = std.string.fromStringz(Char)(return scope inout(Char)* cString) if (isSomeChar!Char)
@paramcString A null-terminated c-style string.@returns

A D-style array of char, wchar or dchar referencing the same string. The returned array will retain the same type qualifiers as the input.

Important Note: The returned array is a slice of the original buffer. The original data is not changed and not copied.

fromStringz
,
(alias) font_libraries_harfbuzz_shape_features.toStringz = immutable(char)* std.string.toStringz(scope const(char)[] s) pure nothrow @trusted
@params A D-style string.@returns

A C-style null-terminated string equivalent to s. s must not contain embedded '\0''s as any C function will treat the first '\0' that it sees as the end of the string. If s.empty is true, then a string containing only '\0' is returned.

Important Note: When passing a char* to a C function, and the C function keeps it around for any reason, make sure that you keep a reference to it in your D code. Otherwise, it may become invalid during a garbage collection cycle and cause a nasty bug when the C code tries to use it.

toStringz
,
(alias template) font_libraries_harfbuzz_shape_features.strip = std.string.strip(Range)(Range str) if (isSomeString!Range || isRandomAccessRange!Range && hasLength!Range && hasSlicing!Range && !isConvertibleToString!Range && isSomeChar!(ElementEncodingType!Range))

Strips both leading and trailing whitespace (as defined by isWhite) or as specified in the second argument.

@paramstr string or random access range of characters@paramchars string of characters to be stripped@paramleftChars string of leading characters to be stripped@paramrightChars string of trailing characters to be stripped@returnsslice of str stripped of leading and trailing whitespace or characters as specified in the second argument.@seeGeneric stripping on ranges: strip
strip
;
import
(package) std
std
.
(module) std.process

Functions for starting and interacting with other processes, and for working with the current process' execution environment.

Process handling

  • `spawnProcess` spawns a new `process`, optionally assigning it an
        

    arbitrary set of standard input, output, and error streams. The function returns immediately, leaving the child process to execute in parallel with its parent. All other functions in this module that spawn processes are built around spawnProcess.

  • `wait` makes the parent `process` wait for a child `process` to
        

    terminate. In general one should always do this, to avoid child processes becoming "zombies" when the parent process exits. Scope guards are perfect for this – see the spawnProcess documentation for examples. tryWait is similar to wait, but does not block if the process has not yet terminated.

  • `pipeProcess` also spawns a child `process` which runs
        

    in parallel with its parent. However, instead of taking arbitrary streams, it automatically creates a set of pipes that allow the parent to communicate with the child through the child's standard input, output, and/or error streams. This function corresponds roughly to C's popen function.

  • `execute` starts a new `process` and waits for it
        

    to complete before returning. Additionally, it captures the process' standard output and error streams and returns the output of these as a string.

  • `spawnShell`, `pipeShell` and `executeShell` work like
        

    spawnProcess, pipeProcess and execute, respectively, except that they take a single command string and run it through the current user's default command interpreter. executeShell corresponds roughly to C's system function.

  • `kill` attempts to terminate a running `process`.
    
    

The following table compactly summarises the different process creation functions and how they relate to each other:

Runs program directly
Runs shell command
Low-level process creation
spawnProcess
spawnShell
Automatic input/output redirection using pipes
pipeProcess
pipeShell
Execute and wait for completion, collect output
execute
executeShell

Other functionality

  • `pipe` is used to create unidirectional pipes.
    
  • `environment` is an interface through which the current `process`'
        

    environment variables can be read and manipulated.

  • `escapeShellCommand` and `escapeShellFileName` are useful
        

    for constructing shell command lines in a portable way.

Source

std/process.d

Note

Most of the functionality in this module is not available on iOS, tvOS and watchOS. The only functions available on those platforms are: environment, thisProcessID and thisThreadID.

@authorsLars Tandle Kyllingstad, Steven Schveighoffer, Vladimir Panteleev@copyrightCopyright (c) 2013, the authors. All rights reserved.@licenseBoost License 1.0.
process
:
(alias) font_libraries_harfbuzz_shape_features.execute = std.typecons.Tuple!(int, "status", string, "output") std.process.execute(scope const(char[])[] args, const(string[string]) env = cast(const(string[string]))null, std.process.Config config = Config(Flags.none, null, null), ulong maxOutput = 18446744073709551615LU, scope const(char)[] workDir = null) @safe

Executes the given program or shell command and returns its exit code and output.

execute and executeShell start a new process using spawnProcess and spawnShell, respectively, and wait for the process to complete before returning. The functions capture what the child process prints to both its standard output and standard error streams, and return this together with its exit code.

auto dmd = execute(["dmd", "myapp.d"]);
if (dmd.status != 0) writeln("Compilation failed:\n", dmd.output);

auto ls = executeShell("ls -l");
if (ls.status != 0) writeln("Failed to retrieve file listing");
else writeln(ls.output);

The args/program/command, env and config parameters are forwarded straight to the underlying spawn functions, and we refer to their documentation for details.

POSIX specific

If the process is terminated by a signal, the status field of the return value will contain a negative number whose absolute value is the signal number. (See wait for details.)

@paramargs An array which contains the program name as the zeroth element and any command-line arguments in the following elements. (See spawnProcess for details.)@paramprogram The program name, without command-line arguments. (See spawnProcess for details.)@paramcommand A shell command which is passed verbatim to the command interpreter. (See spawnShell for details.)@paramenv Additional environment variables for the child process. (See spawnProcess for details.)@paramconfig Flags that control process creation. See Config for an overview of available flags, and note that the retainStd... flags have no effect in this function.@parammaxOutput The maximum number of bytes of output that should be captured.@paramworkDir The working directory for the new process. By default the child process inherits the parent's working directory.@paramshellPath The path to the shell to use to run the specified program. By default this is nativeShell.@returnsAn std.typecons.Tuple!(int, "status", string, "output").@throws

ProcessException on failure to start the process.

StdioException on failure to capture output.

execute
;
import
(package) std
std
.
(module) std.file

Utilities for manipulating files and scanning directories. Functions in this module handle files as a unit, e.g., read or write one file at a time. For opening files and manipulating them via handles refer to module std.stdio.

Category Functions
General exists isDir isFile isSymlink rename thisExePath
Directories chdir dirEntries getcwd mkdir mkdirRecurse rmdir rmdirRecurse tempDir
Files append copy read readText remove slurp write
Symlinks symlink readLink
Attributes attrIsDir attrIsFile attrIsSymlink getAttributes getLinkAttributes getSize setAttributes
Timestamp getTimes getTimesWin setTimes timeLastModified timeLastAccessed timeStatusChanged
Other DirEntry FileException PreserveAttributes SpanMode getAvailableDiskSpace

Source

std/file.d

@copyrightCopyright The D Language Foundation 2007 - 2011.@seeThe official tutorial for an introduction to working with files in D, module std.stdio for opening files and manipulating them via handles, and module std.path for manipulating path strings.@licenseBoost License 1.0.@authorsWalter Bright, Andrei Alexandrescu, Jonathan M Davis
file
:
(alias template) font_libraries_harfbuzz_shape_features.exists = std.file.exists(R)(R name) if (isSomeFiniteCharInputRange!R && !isConvertibleToString!R)

Determine whether the given file (or directory) exists.

@paramname string or range of characters representing the file name@returnstrue if the file name specified as input exists
exists
;
// --------------------------------------------------------------------------- // HarfBuzz C ABI, the subset this program needs. Layouts follow hb-common.h, // hb-buffer.h and hb-ot-var.h: every field is a 32-bit scalar. // --------------------------------------------------------------------------- extern (C) nothrow @nogc { struct
(struct) font_libraries_harfbuzz_shape_features.hb_blob_t
hb_blob_t
;
struct
(struct) font_libraries_harfbuzz_shape_features.hb_face_t
hb_face_t
;
struct
(struct) font_libraries_harfbuzz_shape_features.hb_font_t
hb_font_t
;
struct
(struct) font_libraries_harfbuzz_shape_features.hb_buffer_t
hb_buffer_t
;
alias
(alias) font_libraries_harfbuzz_shape_features.hb_codepoint_t = uint
hb_codepoint_t
= uint;
alias
(alias) font_libraries_harfbuzz_shape_features.hb_position_t = int
hb_position_t
= int;
alias
(alias) font_libraries_harfbuzz_shape_features.hb_tag_t = uint
hb_tag_t
= uint;
alias
(alias) font_libraries_harfbuzz_shape_features.hb_bool_t = int
hb_bool_t
= int;
struct
(struct) font_libraries_harfbuzz_shape_features.hb_glyph_info_t
hb_glyph_info_t
{
(alias) font_libraries_harfbuzz_shape_features.hb_codepoint_t = uint
hb_codepoint_t
(field) uint font_libraries_harfbuzz_shape_features.hb_glyph_info_t.codepoint
codepoint
; // glyph id after shaping
uint
(field) uint font_libraries_harfbuzz_shape_features.hb_glyph_info_t.mask
mask
;
uint
(field) uint font_libraries_harfbuzz_shape_features.hb_glyph_info_t.cluster
cluster
; // index into the input (UTF-8 byte offset here)
uint
(field) uint font_libraries_harfbuzz_shape_features.hb_glyph_info_t.var1
var1
,
(field) uint font_libraries_harfbuzz_shape_features.hb_glyph_info_t.var2
var2
; // hb_var_int_t, private
} struct
(struct) font_libraries_harfbuzz_shape_features.hb_glyph_position_t
hb_glyph_position_t
{
(alias) font_libraries_harfbuzz_shape_features.hb_position_t = int
hb_position_t
(field) int font_libraries_harfbuzz_shape_features.hb_glyph_position_t.x_advance
x_advance
,
(field) int font_libraries_harfbuzz_shape_features.hb_glyph_position_t.y_advance
y_advance
,
(field) int font_libraries_harfbuzz_shape_features.hb_glyph_position_t.x_offset
x_offset
,
(field) int font_libraries_harfbuzz_shape_features.hb_glyph_position_t.y_offset
y_offset
;
uint
(field) uint font_libraries_harfbuzz_shape_features.hb_glyph_position_t.var
var
; // private
} struct
(struct) font_libraries_harfbuzz_shape_features.hb_feature_t
hb_feature_t
{
(alias) font_libraries_harfbuzz_shape_features.hb_tag_t = uint
hb_tag_t
(field) uint font_libraries_harfbuzz_shape_features.hb_feature_t.tag
tag
;
uint
(field) uint font_libraries_harfbuzz_shape_features.hb_feature_t.value
value
;
uint
(field) uint font_libraries_harfbuzz_shape_features.hb_feature_t.start
start
,
(field) uint font_libraries_harfbuzz_shape_features.hb_feature_t.end
end
;
} struct
(struct) font_libraries_harfbuzz_shape_features.hb_variation_t
hb_variation_t
{
(alias) font_libraries_harfbuzz_shape_features.hb_tag_t = uint
hb_tag_t
(field) uint font_libraries_harfbuzz_shape_features.hb_variation_t.tag
tag
;
float
(field) float font_libraries_harfbuzz_shape_features.hb_variation_t.value
value
;
} struct
(struct) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t
hb_ot_var_axis_info_t
{ uint
(field) uint font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.axis_index
axis_index
;
(alias) font_libraries_harfbuzz_shape_features.hb_tag_t = uint
hb_tag_t
(field) uint font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.tag
tag
;
uint
(field) uint font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.name_id
name_id
;
uint
(field) uint font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.flags
flags
;
float
(field) float font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.min_value
min_value
,
(field) float font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.default_value
default_value
,
(field) float font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.max_value
max_value
;
uint
(field) uint font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.reserved
reserved
;
}
(struct) font_libraries_harfbuzz_shape_features.hb_blob_t
hb_blob_t
*
font_libraries_harfbuzz_shape_features.hb_blob_t* font_libraries_harfbuzz_shape_features.hb_blob_create_from_file(const(char)* file_name) nothrow @nogc
hb_blob_create_from_file
(const(char)*
(parameter) const(char)* file_name
file_name
);
void
void font_libraries_harfbuzz_shape_features.hb_blob_destroy(font_libraries_harfbuzz_shape_features.hb_blob_t*) nothrow @nogc
hb_blob_destroy
(
(struct) font_libraries_harfbuzz_shape_features.hb_blob_t
hb_blob_t
*);
uint
uint font_libraries_harfbuzz_shape_features.hb_blob_get_length(font_libraries_harfbuzz_shape_features.hb_blob_t*) nothrow @nogc
hb_blob_get_length
(
(struct) font_libraries_harfbuzz_shape_features.hb_blob_t
hb_blob_t
*);
(struct) font_libraries_harfbuzz_shape_features.hb_face_t
hb_face_t
*
font_libraries_harfbuzz_shape_features.hb_face_t* font_libraries_harfbuzz_shape_features.hb_face_create(font_libraries_harfbuzz_shape_features.hb_blob_t*, uint index) nothrow @nogc
hb_face_create
(
(struct) font_libraries_harfbuzz_shape_features.hb_blob_t
hb_blob_t
*, uint
(parameter) uint index
index
);
void
void font_libraries_harfbuzz_shape_features.hb_face_destroy(font_libraries_harfbuzz_shape_features.hb_face_t*) nothrow @nogc
hb_face_destroy
(
(struct) font_libraries_harfbuzz_shape_features.hb_face_t
hb_face_t
*);
uint
uint font_libraries_harfbuzz_shape_features.hb_face_get_upem(const(font_libraries_harfbuzz_shape_features.hb_face_t)*) nothrow @nogc
hb_face_get_upem
(const(
(struct) font_libraries_harfbuzz_shape_features.hb_face_t
hb_face_t
)*);
uint
uint font_libraries_harfbuzz_shape_features.hb_face_get_glyph_count(const(font_libraries_harfbuzz_shape_features.hb_face_t)*) nothrow @nogc
hb_face_get_glyph_count
(const(
(struct) font_libraries_harfbuzz_shape_features.hb_face_t
hb_face_t
)*);
(struct) font_libraries_harfbuzz_shape_features.hb_font_t
hb_font_t
*
font_libraries_harfbuzz_shape_features.hb_font_t* font_libraries_harfbuzz_shape_features.hb_font_create(font_libraries_harfbuzz_shape_features.hb_face_t*) nothrow @nogc
hb_font_create
(
(struct) font_libraries_harfbuzz_shape_features.hb_face_t
hb_face_t
*);
void
void font_libraries_harfbuzz_shape_features.hb_font_destroy(font_libraries_harfbuzz_shape_features.hb_font_t*) nothrow @nogc
hb_font_destroy
(
(struct) font_libraries_harfbuzz_shape_features.hb_font_t
hb_font_t
*);
void
void font_libraries_harfbuzz_shape_features.hb_ot_font_set_funcs(font_libraries_harfbuzz_shape_features.hb_font_t*) nothrow @nogc
hb_ot_font_set_funcs
(
(struct) font_libraries_harfbuzz_shape_features.hb_font_t
hb_font_t
*);
void
void font_libraries_harfbuzz_shape_features.hb_font_set_scale(font_libraries_harfbuzz_shape_features.hb_font_t*, int x_scale, int y_scale) nothrow @nogc
hb_font_set_scale
(
(struct) font_libraries_harfbuzz_shape_features.hb_font_t
hb_font_t
*, int
(parameter) int x_scale
x_scale
, int
(parameter) int y_scale
y_scale
);
void
void font_libraries_harfbuzz_shape_features.hb_font_set_variations(font_libraries_harfbuzz_shape_features.hb_font_t*, const(font_libraries_harfbuzz_shape_features.hb_variation_t)*, uint count) nothrow @nogc
hb_font_set_variations
(
(struct) font_libraries_harfbuzz_shape_features.hb_font_t
hb_font_t
*, const(
(struct) font_libraries_harfbuzz_shape_features.hb_variation_t
hb_variation_t
)*, uint
(parameter) uint count
count
);
(alias) font_libraries_harfbuzz_shape_features.hb_bool_t = int
hb_bool_t
int font_libraries_harfbuzz_shape_features.hb_font_get_glyph_name(font_libraries_harfbuzz_shape_features.hb_font_t*, uint glyph, char* name, uint size) nothrow @nogc
hb_font_get_glyph_name
(
(struct) font_libraries_harfbuzz_shape_features.hb_font_t
hb_font_t
*,
(alias) font_libraries_harfbuzz_shape_features.hb_codepoint_t = uint
hb_codepoint_t
(parameter) uint glyph
glyph
, char*
(parameter) char* name
name
, uint
(parameter) uint size
size
);
(struct) font_libraries_harfbuzz_shape_features.hb_buffer_t
hb_buffer_t
*
font_libraries_harfbuzz_shape_features.hb_buffer_t* font_libraries_harfbuzz_shape_features.hb_buffer_create() nothrow @nogc
hb_buffer_create
();
void
void font_libraries_harfbuzz_shape_features.hb_buffer_destroy(font_libraries_harfbuzz_shape_features.hb_buffer_t*) nothrow @nogc
hb_buffer_destroy
(
(struct) font_libraries_harfbuzz_shape_features.hb_buffer_t
hb_buffer_t
*);
void
void font_libraries_harfbuzz_shape_features.hb_buffer_add_utf8(font_libraries_harfbuzz_shape_features.hb_buffer_t*, const(char)* text, int text_length, uint item_offset, int item_length) nothrow @nogc
hb_buffer_add_utf8
(
(struct) font_libraries_harfbuzz_shape_features.hb_buffer_t
hb_buffer_t
*, const(char)*
(parameter) const(char)* text
text
, int
(parameter) int text_length
text_length
,
uint
(parameter) uint item_offset
item_offset
, int
(parameter) int item_length
item_length
);
void
void font_libraries_harfbuzz_shape_features.hb_buffer_guess_segment_properties(font_libraries_harfbuzz_shape_features.hb_buffer_t*) nothrow @nogc
hb_buffer_guess_segment_properties
(
(struct) font_libraries_harfbuzz_shape_features.hb_buffer_t
hb_buffer_t
*);
uint
uint font_libraries_harfbuzz_shape_features.hb_buffer_get_length(const(font_libraries_harfbuzz_shape_features.hb_buffer_t)*) nothrow @nogc
hb_buffer_get_length
(const(
(struct) font_libraries_harfbuzz_shape_features.hb_buffer_t
hb_buffer_t
)*);
(struct) font_libraries_harfbuzz_shape_features.hb_glyph_info_t
hb_glyph_info_t
*
font_libraries_harfbuzz_shape_features.hb_glyph_info_t* font_libraries_harfbuzz_shape_features.hb_buffer_get_glyph_infos(font_libraries_harfbuzz_shape_features.hb_buffer_t*, uint* length) nothrow @nogc
hb_buffer_get_glyph_infos
(
(struct) font_libraries_harfbuzz_shape_features.hb_buffer_t
hb_buffer_t
*, uint*
(parameter) uint* length
length
);
(struct) font_libraries_harfbuzz_shape_features.hb_glyph_position_t
hb_glyph_position_t
*
font_libraries_harfbuzz_shape_features.hb_glyph_position_t* font_libraries_harfbuzz_shape_features.hb_buffer_get_glyph_positions(font_libraries_harfbuzz_shape_features.hb_buffer_t*, uint* length) nothrow @nogc
hb_buffer_get_glyph_positions
(
(struct) font_libraries_harfbuzz_shape_features.hb_buffer_t
hb_buffer_t
*, uint*
(parameter) uint* length
length
);
void
void font_libraries_harfbuzz_shape_features.hb_shape(font_libraries_harfbuzz_shape_features.hb_font_t*, font_libraries_harfbuzz_shape_features.hb_buffer_t*, const(font_libraries_harfbuzz_shape_features.hb_feature_t)* features, uint num_features) nothrow @nogc
hb_shape
(
(struct) font_libraries_harfbuzz_shape_features.hb_font_t
hb_font_t
*,
(struct) font_libraries_harfbuzz_shape_features.hb_buffer_t
hb_buffer_t
*, const(
(struct) font_libraries_harfbuzz_shape_features.hb_feature_t
hb_feature_t
)*
(parameter) const(font_libraries_harfbuzz_shape_features.hb_feature_t)* features
features
, uint
(parameter) uint num_features
num_features
);
uint
uint font_libraries_harfbuzz_shape_features.hb_ot_layout_table_get_feature_tags(font_libraries_harfbuzz_shape_features.hb_face_t*, uint table_tag, uint start_offset, uint* feature_count, uint* feature_tags) nothrow @nogc
hb_ot_layout_table_get_feature_tags
(
(struct) font_libraries_harfbuzz_shape_features.hb_face_t
hb_face_t
*,
(alias) font_libraries_harfbuzz_shape_features.hb_tag_t = uint
hb_tag_t
(parameter) uint table_tag
table_tag
,
uint
(parameter) uint start_offset
start_offset
, uint*
(parameter) uint* feature_count
feature_count
,
(alias) font_libraries_harfbuzz_shape_features.hb_tag_t = uint
hb_tag_t
*
(parameter) uint* feature_tags
feature_tags
);
uint
uint font_libraries_harfbuzz_shape_features.hb_ot_var_get_axis_count(font_libraries_harfbuzz_shape_features.hb_face_t*) nothrow @nogc
hb_ot_var_get_axis_count
(
(struct) font_libraries_harfbuzz_shape_features.hb_face_t
hb_face_t
*);
uint
uint font_libraries_harfbuzz_shape_features.hb_ot_var_get_axis_infos(font_libraries_harfbuzz_shape_features.hb_face_t*, uint start_offset, uint* axes_count, font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t* axes_array) nothrow @nogc
hb_ot_var_get_axis_infos
(
(struct) font_libraries_harfbuzz_shape_features.hb_face_t
hb_face_t
*, uint
(parameter) uint start_offset
start_offset
, uint*
(parameter) uint* axes_count
axes_count
,
(struct) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t
hb_ot_var_axis_info_t
*
(parameter) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t* axes_array
axes_array
);
} // extern (C) /// `HB_TAG('c','a','l','t')` as a D function: big-endian packed ASCII.
(alias) font_libraries_harfbuzz_shape_features.hb_tag_t = uint
hb_tag_t
uint font_libraries_harfbuzz_shape_features.tag(string s) pure nothrow @nogc @safe

HB_TAG('c','a','l','t') as a D function: big-endian packed ASCII.

tag
(
(alias) object.string = string
string
(parameter) string s
s
) @safe pure nothrow @nogc
in (
(parameter) string s
s
.
(field) ulong string.length
length
== 4)
=> (uint(
(parameter) string s
s
[0]) << 24) | (uint(
(parameter) string s
s
[1]) << 16) | (uint(
(parameter) string s
s
[2]) << 8) | uint(
(parameter) string s
s
[3]);
/// The inverse, by value: four characters, no allocation. char[4]
char[4] font_libraries_harfbuzz_shape_features.tagName(uint t) pure nothrow @nogc @safe

The inverse, by value: four characters, no allocation.

tagName
(
(alias) font_libraries_harfbuzz_shape_features.hb_tag_t = uint
hb_tag_t
(parameter) uint t
t
) @safe pure nothrow @nogc
=> [cast(char)(
(parameter) uint t
t
>> 24), cast(char)(
(parameter) uint t
t
>> 16), cast(char)(
(parameter) uint t
t
>> 8), cast(char)
(parameter) uint t
t
];
(alias) object.string = string
string
string font_libraries_harfbuzz_shape_features.resolveFont(string[] args) @safe
resolveFont
(
(alias) object.string = string
string
[]
(parameter) string[] args
args
) @safe
{ if (
(parameter) string[] args
args
.
(field) ulong string[].length
length
> 1 &&
bool std.file.exists!string(string name) nothrow @nogc @safe

Determine whether the given file (or directory) exists.

@paramname string or range of characters representing the file name@returnstrue if the file name specified as input exists
exists
(
(parameter) string[] args
args
[1]))
return
(parameter) string[] args
args
[1];
try { auto
(local variable) std.typecons.Tuple!(int, "status", string, "output") r
r
=
std.typecons.Tuple!(int, "status", string, "output") std.process.execute(scope const(char[])[] args, const(string[string]) env = cast(const(string[string]))null, std.process.Config config = Config(Flags.none, null, null), ulong maxOutput = 18446744073709551615LU, scope const(char)[] workDir = null) @safe

Executes the given program or shell command and returns its exit code and output.

execute and executeShell start a new process using spawnProcess and spawnShell, respectively, and wait for the process to complete before returning. The functions capture what the child process prints to both its standard output and standard error streams, and return this together with its exit code.

auto dmd = execute(["dmd", "myapp.d"]);
if (dmd.status != 0) writeln("Compilation failed:\n", dmd.output);

auto ls = executeShell("ls -l");
if (ls.status != 0) writeln("Failed to retrieve file listing");
else writeln(ls.output);

The args/program/command, env and config parameters are forwarded straight to the underlying spawn functions, and we refer to their documentation for details.

POSIX specific

If the process is terminated by a signal, the status field of the return value will contain a negative number whose absolute value is the signal number. (See wait for details.)

@paramargs An array which contains the program name as the zeroth element and any command-line arguments in the following elements. (See spawnProcess for details.)@paramprogram The program name, without command-line arguments. (See spawnProcess for details.)@paramcommand A shell command which is passed verbatim to the command interpreter. (See spawnShell for details.)@paramenv Additional environment variables for the child process. (See spawnProcess for details.)@paramconfig Flags that control process creation. See Config for an overview of available flags, and note that the retainStd... flags have no effect in this function.@parammaxOutput The maximum number of bytes of output that should be captured.@paramworkDir The working directory for the new process. By default the child process inherits the parent's working directory.@paramshellPath The path to the shell to use to run the specified program. By default this is nativeShell.@returnsAn std.typecons.Tuple!(int, "status", string, "output").@throws

ProcessException on failure to start the process.

StdioException on failure to capture output.

execute
(["fc-match", "-f", "%{file}", "monospace"]);
if (
(local variable) std.typecons.Tuple!(int, "status", string, "output") r
r
.status == 0 &&
(field) int std.typecons.Tuple!(int, "status", string, "output").__expand_field_0
r
.output.
string std.string.strip!string(string str) pure nothrow @nogc @safe

Strips both leading and trailing whitespace (as defined by isWhite) or as specified in the second argument.

Examples

import std.uni : lineSep, paraSep;
assert(strip("     hello world     ") ==
       "hello world");
assert(strip("\n\t\v\rhello world\n\t\v\r") ==
       "hello world");
assert(strip("hello world") ==
       "hello world");
assert(strip([lineSep] ~ "hello world" ~ [lineSep]) ==
       "hello world");
assert(strip([paraSep] ~ "hello world" ~ [paraSep]) ==
       "hello world");
@paramstr string or random access range of characters@paramchars string of characters to be stripped@paramleftChars string of leading characters to be stripped@paramrightChars string of trailing characters to be stripped@returnsslice of str stripped of leading and trailing whitespace or characters as specified in the second argument.@seeGeneric stripping on ranges: strip
strip
.
(field) string std.typecons.Tuple!(int, "status", string, "output").__expand_field_1
length
&&
bool std.file.exists!string(string name) nothrow @nogc @safe

Determine whether the given file (or directory) exists.

@paramname string or range of characters representing the file name@returnstrue if the file name specified as input exists
exists
(
(local variable) std.typecons.Tuple!(int, "status", string, "output") r
r
.output.
string std.string.strip!string(string str) pure nothrow @nogc @safe

Strips both leading and trailing whitespace (as defined by isWhite) or as specified in the second argument.

Examples

import std.uni : lineSep, paraSep;
assert(strip("     hello world     ") ==
       "hello world");
assert(strip("\n\t\v\rhello world\n\t\v\r") ==
       "hello world");
assert(strip("hello world") ==
       "hello world");
assert(strip([lineSep] ~ "hello world" ~ [lineSep]) ==
       "hello world");
assert(strip([paraSep] ~ "hello world" ~ [paraSep]) ==
       "hello world");
@paramstr string or random access range of characters@paramchars string of characters to be stripped@paramleftChars string of leading characters to be stripped@paramrightChars string of trailing characters to be stripped@returnsslice of str stripped of leading and trailing whitespace or characters as specified in the second argument.@seeGeneric stripping on ranges: strip
strip
))
return
(local variable) std.typecons.Tuple!(int, "status", string, "output") r
r
.output.
string std.string.strip!string(string str) pure nothrow @nogc @safe

Strips both leading and trailing whitespace (as defined by isWhite) or as specified in the second argument.

Examples

import std.uni : lineSep, paraSep;
assert(strip("     hello world     ") ==
       "hello world");
assert(strip("\n\t\v\rhello world\n\t\v\r") ==
       "hello world");
assert(strip("hello world") ==
       "hello world");
assert(strip([lineSep] ~ "hello world" ~ [lineSep]) ==
       "hello world");
assert(strip([paraSep] ~ "hello world" ~ [paraSep]) ==
       "hello world");
@paramstr string or random access range of characters@paramchars string of characters to be stripped@paramleftChars string of leading characters to be stripped@paramrightChars string of trailing characters to be stripped@returnsslice of str stripped of leading and trailing whitespace or characters as specified in the second argument.@seeGeneric stripping on ranges: strip
strip
;
} catch (
(class) object.Exception

The base class of all errors that are safe to catch and handle.

In principle, only thrown objects derived from this class are safe to catch inside a catch block. Thrown objects not derived from Exception represent runtime errors that should not be caught, as certain runtime guarantees may not hold, making it unsafe to continue program execution.

Examples

bool gotCaught;
try
{
    throw new Exception("msg");
}
catch (Exception e)
{
    gotCaught = true;
    assert(e.msg == "msg");
}
assert(gotCaught);
Exception
) {}
return null; } void
void font_libraries_harfbuzz_shape_features.listFeatures(font_libraries_harfbuzz_shape_features.hb_face_t* face, string table) @trusted
listFeatures
(
(struct) font_libraries_harfbuzz_shape_features.hb_face_t
hb_face_t
*
(parameter) font_libraries_harfbuzz_shape_features.hb_face_t* face
face
,
(alias) object.string = string
string
(parameter) string table
table
) @trusted
{
(alias) font_libraries_harfbuzz_shape_features.hb_tag_t = uint
hb_tag_t
[64]
(local variable) uint[64] tags
tags
;
uint
(local variable) uint count
count
=
(local variable) uint[64] tags
tags
.
(constant) ulong uint[64].length = 64LU
length
;
uint font_libraries_harfbuzz_shape_features.hb_ot_layout_table_get_feature_tags(font_libraries_harfbuzz_shape_features.hb_face_t*, uint table_tag, uint start_offset, uint* feature_count, uint* feature_tags) nothrow @nogc
hb_ot_layout_table_get_feature_tags
(
(parameter) font_libraries_harfbuzz_shape_features.hb_face_t* face
face
,
uint font_libraries_harfbuzz_shape_features.tag(string s) pure nothrow @nogc @safe

HB_TAG('c','a','l','t') as a D function: big-endian packed ASCII.

tag
(
(parameter) string table
table
), 0, &
(local variable) uint count
count
,
(local variable) uint[64] tags
tags
.
(constant) uint* uint[64].ptr = &tags
ptr
);
(alias) object.string = string
string
(local variable) string line
line
;
foreach (
(parameter) uint t
t
;
(local variable) uint[64] tags
tags
[0 ..
(local variable) uint count
count
])
(local variable) string line
line
~=
char[4] font_libraries_harfbuzz_shape_features.tagName(uint t) pure nothrow @nogc @safe

The inverse, by value: four characters, no allocation.

tagName
(
(local variable) uint t
t
)[] ~ " ";
void std.stdio.writefln!(char, string, uint, string)(in char[] fmt, string __param_1, uint __param_2, string __param_3) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("%s features (%d): %s",
(parameter) string table
table
,
(local variable) uint count
count
,
(local variable) string line
line
);
} void
void font_libraries_harfbuzz_shape_features.shape(font_libraries_harfbuzz_shape_features.hb_font_t* font, string text, const(font_libraries_harfbuzz_shape_features.hb_feature_t)[] features, string label) @trusted
shape
(
(struct) font_libraries_harfbuzz_shape_features.hb_font_t
hb_font_t
*
(parameter) font_libraries_harfbuzz_shape_features.hb_font_t* font
font
,
(alias) object.string = string
string
(parameter) string text
text
, const(
(struct) font_libraries_harfbuzz_shape_features.hb_feature_t
hb_feature_t
)[]
(parameter) const(font_libraries_harfbuzz_shape_features.hb_feature_t)[] features
features
,
(alias) object.string = string
string
(parameter) string label
label
) @trusted
{ auto
(local variable) font_libraries_harfbuzz_shape_features.hb_buffer_t* buf
buf
=
font_libraries_harfbuzz_shape_features.hb_buffer_t* font_libraries_harfbuzz_shape_features.hb_buffer_create() nothrow @nogc
hb_buffer_create
();
scope (exit)
void font_libraries_harfbuzz_shape_features.hb_buffer_destroy(font_libraries_harfbuzz_shape_features.hb_buffer_t*) nothrow @nogc
hb_buffer_destroy
(
(local variable) font_libraries_harfbuzz_shape_features.hb_buffer_t* buf
buf
);
void font_libraries_harfbuzz_shape_features.hb_buffer_add_utf8(font_libraries_harfbuzz_shape_features.hb_buffer_t*, const(char)* text, int text_length, uint item_offset, int item_length) nothrow @nogc
hb_buffer_add_utf8
(
(local variable) font_libraries_harfbuzz_shape_features.hb_buffer_t* buf
buf
,
(parameter) string text
text
.
(field) immutable(char)* string.ptr
ptr
, cast(int)
(parameter) string text
text
.
(field) ulong string.length
length
, 0, cast(int)
(parameter) string text
text
.
(field) ulong string.length
length
);
void font_libraries_harfbuzz_shape_features.hb_buffer_guess_segment_properties(font_libraries_harfbuzz_shape_features.hb_buffer_t*) nothrow @nogc
hb_buffer_guess_segment_properties
(
(local variable) font_libraries_harfbuzz_shape_features.hb_buffer_t* buf
buf
);
void font_libraries_harfbuzz_shape_features.hb_shape(font_libraries_harfbuzz_shape_features.hb_font_t*, font_libraries_harfbuzz_shape_features.hb_buffer_t*, const(font_libraries_harfbuzz_shape_features.hb_feature_t)* features, uint num_features) nothrow @nogc
hb_shape
(
(parameter) font_libraries_harfbuzz_shape_features.hb_font_t* font
font
,
(local variable) font_libraries_harfbuzz_shape_features.hb_buffer_t* buf
buf
,
(parameter) const(font_libraries_harfbuzz_shape_features.hb_feature_t)[] features
features
.
(field) const(font_libraries_harfbuzz_shape_features.hb_feature_t)* const(font_libraries_harfbuzz_shape_features.hb_feature_t)[].ptr
ptr
, cast(uint)
(parameter) const(font_libraries_harfbuzz_shape_features.hb_feature_t)[] features
features
.
(field) ulong const(font_libraries_harfbuzz_shape_features.hb_feature_t)[].length
length
);
uint
(local variable) uint n
n
;
auto
(local variable) font_libraries_harfbuzz_shape_features.hb_glyph_info_t* infos
infos
=
font_libraries_harfbuzz_shape_features.hb_glyph_info_t* font_libraries_harfbuzz_shape_features.hb_buffer_get_glyph_infos(font_libraries_harfbuzz_shape_features.hb_buffer_t*, uint* length) nothrow @nogc
hb_buffer_get_glyph_infos
(
(local variable) font_libraries_harfbuzz_shape_features.hb_buffer_t* buf
buf
, &
(local variable) uint n
n
);
auto
(local variable) font_libraries_harfbuzz_shape_features.hb_glyph_position_t* pos
pos
=
font_libraries_harfbuzz_shape_features.hb_glyph_position_t* font_libraries_harfbuzz_shape_features.hb_buffer_get_glyph_positions(font_libraries_harfbuzz_shape_features.hb_buffer_t*, uint* length) nothrow @nogc
hb_buffer_get_glyph_positions
(
(local variable) font_libraries_harfbuzz_shape_features.hb_buffer_t* buf
buf
, &
(local variable) uint n
n
);
void std.stdio.writefln!(char, string, uint)(in char[] fmt, string __param_1, uint __param_2) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" %-14s %d glyphs:",
(parameter) string label
label
,
(local variable) uint n
n
);
foreach (
(local variable) uint i
i
; 0 ..
(local variable) uint n
n
)
{ char[64]
(local variable) char[64] name
name
;
if (!
int font_libraries_harfbuzz_shape_features.hb_font_get_glyph_name(font_libraries_harfbuzz_shape_features.hb_font_t*, uint glyph, char* name, uint size) nothrow @nogc
hb_font_get_glyph_name
(
(parameter) font_libraries_harfbuzz_shape_features.hb_font_t* font
font
,
(local variable) font_libraries_harfbuzz_shape_features.hb_glyph_info_t* infos
infos
[
(local variable) uint i
i
].
(field) uint font_libraries_harfbuzz_shape_features.hb_glyph_info_t.codepoint
codepoint
,
(local variable) char[64] name
name
.
(constant) char* char[64].ptr = &name
ptr
,
(local variable) char[64] name
name
.
(constant) ulong char[64].length = 64LU
length
))
(local variable) char[64] name
name
[0] = 0;
void std.stdio.writefln!(char, uint, uint, int, char[])(in char[] fmt, uint __param_1, uint __param_2, int __param_3, char[] __param_4) @safe

Equivalent to writef(fmt, args, '\n').

writefln
(" gid %5d cluster %2d adv %5d %s",
(local variable) font_libraries_harfbuzz_shape_features.hb_glyph_info_t* infos
infos
[
(local variable) uint i
i
].
(field) uint font_libraries_harfbuzz_shape_features.hb_glyph_info_t.codepoint
codepoint
,
(local variable) font_libraries_harfbuzz_shape_features.hb_glyph_info_t* infos
infos
[
(local variable) uint i
i
].
(field) uint font_libraries_harfbuzz_shape_features.hb_glyph_info_t.cluster
cluster
,
(local variable) font_libraries_harfbuzz_shape_features.hb_glyph_position_t* pos
pos
[
(local variable) uint i
i
].
(field) int font_libraries_harfbuzz_shape_features.hb_glyph_position_t.x_advance
x_advance
,
inout(char)[] std.string.fromStringz!char(return scope inout(char)* cString) pure nothrow @nogc @system
@paramcString A null-terminated c-style string.@returns

A D-style array of char, wchar or dchar referencing the same string. The returned array will retain the same type qualifiers as the input.

Important Note: The returned array is a slice of the original buffer. The original data is not changed and not copied.

fromStringz
(
(local variable) char[64] name
name
.
(constant) char* char[64].ptr = &name
ptr
));
} } int
int D main(string[] args)
main
(
(alias) object.string = string
string
[]
(parameter) string[] args
args
)
{ const
(local variable) const(string) path
path
=
string font_libraries_harfbuzz_shape_features.resolveFont(string[] args) @safe
resolveFont
(
(parameter) string[] args
args
);
if (
(local variable) const(string) path
path
is null)
{
void std.stdio.writeln!string(string __param_0) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("SKIP: no font file resolved (pass a path, or install fontconfig)");
return 0; } auto
(local variable) font_libraries_harfbuzz_shape_features.hb_blob_t* blob
blob
=
font_libraries_harfbuzz_shape_features.hb_blob_t* font_libraries_harfbuzz_shape_features.hb_blob_create_from_file(const(char)* file_name) nothrow @nogc
hb_blob_create_from_file
(
(local variable) const(string) path
path
.
immutable(char)* std.string.toStringz(scope const(char)[] s) pure nothrow @trusted

Examples

import core.stdc.string : strlen;
import std.conv : to;

auto p = toStringz("foo");
assert(strlen(p) == 3);
const(char)[] foo = "abbzxyzzy";
p = toStringz(foo[3 .. 5]);
assert(strlen(p) == 2);

string test = "";
p = toStringz(test);
assert(*p == 0);

test = "\0";
p = toStringz(test);
assert(*p == 0);

test = "foo\0";
p = toStringz(test);
assert(p[0] == 'f' && p[1] == 'o' && p[2] == 'o' && p[3] == 0);

const string test2 = "";
p = toStringz(test2);
assert(*p == 0);

assert(toStringz([]) is toStringz(""));
@params A D-style string.@returns

A C-style null-terminated string equivalent to s. s must not contain embedded '\0''s as any C function will treat the first '\0' that it sees as the end of the string. If ``s.empty is true, then a string containing only '\0' is returned.

Important Note: When passing a char* to a C function, and the C function keeps it around for any reason, make sure that you keep a reference to it in your D code. Otherwise, it may become invalid during a garbage collection cycle and cause a nasty bug when the C code tries to use it.

toStringz
);
scope (exit)
void font_libraries_harfbuzz_shape_features.hb_blob_destroy(font_libraries_harfbuzz_shape_features.hb_blob_t*) nothrow @nogc
hb_blob_destroy
(
(local variable) font_libraries_harfbuzz_shape_features.hb_blob_t* blob
blob
);
if (
uint font_libraries_harfbuzz_shape_features.hb_blob_get_length(font_libraries_harfbuzz_shape_features.hb_blob_t*) nothrow @nogc
hb_blob_get_length
(
(local variable) font_libraries_harfbuzz_shape_features.hb_blob_t* blob
blob
) == 0)
{
void std.stdio.writeln!(string, string)(string __param_0, string __param_1) @safe

Equivalent to write(args, '\n'). Calling writeln without arguments is valid and just prints a newline to the standard output.

Example

Reads stdin and writes it to stdout with an argument counter.

import std.stdio;

void main()
{
    string line;

    for (size_t count = 0; (line = readln) !is null; count++)
    {
         writeln("Input ", count, ": ", line);
    }
}
@paramargs the items to write to stdout@throwsIn case of an I/O error, throws an StdioException.
writeln
("SKIP: empty blob for ",
(local variable) const(string) path
path
);
return 0; } auto
(local variable) font_libraries_harfbuzz_shape_features.hb_face_t* face
face
=
font_libraries_harfbuzz_shape_features.hb_face_t* font_libraries_harfbuzz_shape_features.hb_face_create(font_libraries_harfbuzz_shape_features.hb_blob_t*, uint index) nothrow @nogc
hb_face_create
(
(local variable) font_libraries_harfbuzz_shape_features.hb_blob_t* blob
blob
, 0);
scope (exit)
void font_libraries_harfbuzz_shape_features.hb_face_destroy(font_libraries_harfbuzz_shape_features.hb_face_t*) nothrow @nogc
hb_face_destroy
(
(local variable) font_libraries_harfbuzz_shape_features.hb_face_t* face
face
);
const
(local variable) const(uint) upem
upem
=
uint font_libraries_harfbuzz_shape_features.hb_face_get_upem(const(font_libraries_harfbuzz_shape_features.hb_face_t)*) nothrow @nogc
hb_face_get_upem
(
(local variable) font_libraries_harfbuzz_shape_features.hb_face_t* face
face
);
void std.stdio.writefln!(char, string)(in char[] fmt, string __param_1) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("font: %s",
(local variable) const(string) path
path
);
void std.stdio.writefln!(char, const(uint), uint, uint)(in char[] fmt, const(uint) __param_1, uint __param_2, uint __param_3) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("upem %d, %d glyphs, %d variation axes",
(local variable) const(uint) upem
upem
,
uint font_libraries_harfbuzz_shape_features.hb_face_get_glyph_count(const(font_libraries_harfbuzz_shape_features.hb_face_t)*) nothrow @nogc
hb_face_get_glyph_count
(
(local variable) font_libraries_harfbuzz_shape_features.hb_face_t* face
face
),
uint font_libraries_harfbuzz_shape_features.hb_ot_var_get_axis_count(font_libraries_harfbuzz_shape_features.hb_face_t*) nothrow @nogc
hb_ot_var_get_axis_count
(
(local variable) font_libraries_harfbuzz_shape_features.hb_face_t* face
face
));
// (2) inspector inventory
void font_libraries_harfbuzz_shape_features.listFeatures(font_libraries_harfbuzz_shape_features.hb_face_t* face, string table) @trusted
listFeatures
(
(local variable) font_libraries_harfbuzz_shape_features.hb_face_t* face
face
, "GSUB");
void font_libraries_harfbuzz_shape_features.listFeatures(font_libraries_harfbuzz_shape_features.hb_face_t* face, string table) @trusted
listFeatures
(
(local variable) font_libraries_harfbuzz_shape_features.hb_face_t* face
face
, "GPOS");
// (3) axes, and a variation set before shaping
(struct) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t
hb_ot_var_axis_info_t
[16]
(local variable) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t[16] axes
axes
;
uint
(local variable) uint axisCount
axisCount
=
(local variable) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t[16] axes
axes
.
(constant) ulong font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t[16].length = 16LU
length
;
uint font_libraries_harfbuzz_shape_features.hb_ot_var_get_axis_infos(font_libraries_harfbuzz_shape_features.hb_face_t*, uint start_offset, uint* axes_count, font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t* axes_array) nothrow @nogc
hb_ot_var_get_axis_infos
(
(local variable) font_libraries_harfbuzz_shape_features.hb_face_t* face
face
, 0, &
(local variable) uint axisCount
axisCount
,
(local variable) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t[16] axes
axes
.
(constant) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t* font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t[16].ptr = &axes
ptr
);
(struct) font_libraries_harfbuzz_shape_features.hb_variation_t
hb_variation_t
[1]
(local variable) font_libraries_harfbuzz_shape_features.hb_variation_t[1] variations
variations
;
foreach (
(parameter) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t a
a
;
(local variable) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t[16] axes
axes
[0 ..
(local variable) uint axisCount
axisCount
])
{
void std.stdio.writefln!(char, char[], float, float, float)(in char[] fmt, char[] __param_1, float __param_2, float __param_3, float __param_4) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("axis %s min %g default %g max %g",
char[4] font_libraries_harfbuzz_shape_features.tagName(uint t) pure nothrow @nogc @safe

The inverse, by value: four characters, no allocation.

tagName
(
(local variable) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t a
a
.
(field) uint font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.tag
tag
)[],
(local variable) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t a
a
.
(field) float font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.min_value
min_value
,
(local variable) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t a
a
.
(field) float font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.default_value
default_value
,
(local variable) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t a
a
.
(field) float font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.max_value
max_value
);
if (
(local variable) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t a
a
.
(field) uint font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.tag
tag
==
uint font_libraries_harfbuzz_shape_features.tag(string s) pure nothrow @nogc @safe

HB_TAG('c','a','l','t') as a D function: big-endian packed ASCII.

tag
("wght"))
(local variable) font_libraries_harfbuzz_shape_features.hb_variation_t[1] variations
variations
[0] =
(struct) font_libraries_harfbuzz_shape_features.hb_variation_t
hb_variation_t
(
(local variable) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t a
a
.
(field) uint font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.tag
tag
,
(local variable) font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t a
a
.
(field) float font_libraries_harfbuzz_shape_features.hb_ot_var_axis_info_t.max_value
max_value
);
} auto
(local variable) font_libraries_harfbuzz_shape_features.hb_font_t* font
font
=
font_libraries_harfbuzz_shape_features.hb_font_t* font_libraries_harfbuzz_shape_features.hb_font_create(font_libraries_harfbuzz_shape_features.hb_face_t*) nothrow @nogc
hb_font_create
(
(local variable) font_libraries_harfbuzz_shape_features.hb_face_t* face
face
);
scope (exit)
void font_libraries_harfbuzz_shape_features.hb_font_destroy(font_libraries_harfbuzz_shape_features.hb_font_t*) nothrow @nogc
hb_font_destroy
(
(local variable) font_libraries_harfbuzz_shape_features.hb_font_t* font
font
);
void font_libraries_harfbuzz_shape_features.hb_ot_font_set_funcs(font_libraries_harfbuzz_shape_features.hb_font_t*) nothrow @nogc
hb_ot_font_set_funcs
(
(local variable) font_libraries_harfbuzz_shape_features.hb_font_t* font
font
); // HarfBuzz's own OpenType font functions; no FreeType
void font_libraries_harfbuzz_shape_features.hb_font_set_scale(font_libraries_harfbuzz_shape_features.hb_font_t*, int x_scale, int y_scale) nothrow @nogc
hb_font_set_scale
(
(local variable) font_libraries_harfbuzz_shape_features.hb_font_t* font
font
,
(local variable) const(uint) upem
upem
,
(local variable) const(uint) upem
upem
); // advances in design units
if (
(local variable) font_libraries_harfbuzz_shape_features.hb_variation_t[1] variations
variations
[0].
(field) uint font_libraries_harfbuzz_shape_features.hb_variation_t.tag
tag
!= 0)
{
void font_libraries_harfbuzz_shape_features.hb_font_set_variations(font_libraries_harfbuzz_shape_features.hb_font_t*, const(font_libraries_harfbuzz_shape_features.hb_variation_t)*, uint count) nothrow @nogc
hb_font_set_variations
(
(local variable) font_libraries_harfbuzz_shape_features.hb_font_t* font
font
,
(local variable) font_libraries_harfbuzz_shape_features.hb_variation_t[1] variations
variations
.
(constant) font_libraries_harfbuzz_shape_features.hb_variation_t* font_libraries_harfbuzz_shape_features.hb_variation_t[1].ptr = &variations
ptr
, 1);
void std.stdio.writefln!(char, char[], float)(in char[] fmt, char[] __param_1, float __param_2) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("variation set: %s = %g",
char[4] font_libraries_harfbuzz_shape_features.tagName(uint t) pure nothrow @nogc @safe

The inverse, by value: four characters, no allocation.

tagName
(
(local variable) font_libraries_harfbuzz_shape_features.hb_variation_t[1] variations
variations
[0].
(field) uint font_libraries_harfbuzz_shape_features.hb_variation_t.tag
tag
)[],
(local variable) font_libraries_harfbuzz_shape_features.hb_variation_t[1] variations
variations
[0].
(field) float font_libraries_harfbuzz_shape_features.hb_variation_t.value
value
);
} // (4) the same text, contextual ligatures on and off const
(local variable) const(string) text
text
= "a -> b != c ffi";
const
(local variable) const(font_libraries_harfbuzz_shape_features.hb_feature_t[]) on
on
= [
(struct) font_libraries_harfbuzz_shape_features.hb_feature_t
hb_feature_t
(
uint font_libraries_harfbuzz_shape_features.tag(string s) pure nothrow @nogc @safe

HB_TAG('c','a','l','t') as a D function: big-endian packed ASCII.

tag
("calt"), 1, 0, uint.
(constant) uint uint.max = 4294967295u
max
),
(struct) font_libraries_harfbuzz_shape_features.hb_feature_t
hb_feature_t
(
uint font_libraries_harfbuzz_shape_features.tag(string s) pure nothrow @nogc @safe

HB_TAG('c','a','l','t') as a D function: big-endian packed ASCII.

tag
("liga"), 1, 0, uint.
(constant) uint uint.max = 4294967295u
max
)];
const
(local variable) const(font_libraries_harfbuzz_shape_features.hb_feature_t[]) off
off
= [
(struct) font_libraries_harfbuzz_shape_features.hb_feature_t
hb_feature_t
(
uint font_libraries_harfbuzz_shape_features.tag(string s) pure nothrow @nogc @safe

HB_TAG('c','a','l','t') as a D function: big-endian packed ASCII.

tag
("calt"), 0, 0, uint.
(constant) uint uint.max = 4294967295u
max
),
(struct) font_libraries_harfbuzz_shape_features.hb_feature_t
hb_feature_t
(
uint font_libraries_harfbuzz_shape_features.tag(string s) pure nothrow @nogc @safe

HB_TAG('c','a','l','t') as a D function: big-endian packed ASCII.

tag
("liga"), 0, 0, uint.
(constant) uint uint.max = 4294967295u
max
)];
void std.stdio.writefln!(char, const(string)[])(in char[] fmt, const(string)[] __param_1) @safe

Equivalent to writef(fmt, args, '\n').

writefln
("shaping %(%s%):", [
(local variable) const(string) text
text
]);
void font_libraries_harfbuzz_shape_features.shape(font_libraries_harfbuzz_shape_features.hb_font_t* font, string text, const(font_libraries_harfbuzz_shape_features.hb_feature_t)[] features, string label) @trusted
shape
(
(local variable) font_libraries_harfbuzz_shape_features.hb_font_t* font
font
,
(local variable) const(string) text
text
,
(local variable) const(font_libraries_harfbuzz_shape_features.hb_feature_t[]) on
on
, "calt+liga on");
void font_libraries_harfbuzz_shape_features.shape(font_libraries_harfbuzz_shape_features.hb_font_t* font, string text, const(font_libraries_harfbuzz_shape_features.hb_feature_t)[] features, string label) @trusted
shape
(
(local variable) font_libraries_harfbuzz_shape_features.hb_font_t* font
font
,
(local variable) const(string) text
text
,
(local variable) const(font_libraries_harfbuzz_shape_features.hb_feature_t[]) off
off
, "calt+liga off");
return 0; }