ligature-cells.dhover×383all
#!/usr/bin/env dub
/+ dub.sdl:
    name "font_libraries_ligature_cells"
    targetPath "build"
    libs "harfbuzz"
    buildType "checked" {
        buildOptions "optimize" "inline" "debugInfo"
    }
+/
/**
 * Do programming-font ligatures fit a cell grid? Shapes 160 ligature
 * sequences, the union of the Fira Code, JetBrains Mono, Cascadia Code and
 * Maple Mono inventories, each as `a<seq>b`, with `calt`+`liga` on and off,
 * and reports per face:
 *
 *   1. how many sequences shape differently with the features on;
 *   2. how many change the glyph count — a ligature that merges characters
 *      into fewer glyphs would need multi-cell glyph placement in a terminal;
 *   3. how many produce an advance other than the cell (the advance of `0`);
 *   4. how many draw ink outside a glyph's own cell, and the worst reach in
 *      cells — a renderer that clips each glyph to its cell cuts these.
 *
 * Spike S3 of docs/specs/font/PLAN.md; decision FTX7 in
 * docs/specs/font/decisions.md records the result.
 *
 * Run with: dub run --single ligature-cells.d [-- font.ttf ...]
 *
 * Font resolution: the arguments if given, else `fc-match -f %{file}
 * monospace`. If neither yields a readable file, prints a `SKIP:` line and
 * exits 0 so CI stays green.
 */
module 
(module) font_libraries_ligature_cells

Do programming-font ligatures fit a cell grid? Shapes 160 ligature sequences, the union of the Fira Code, JetBrains Mono, Cascadia Code and Maple Mono inventories, each as a<seq>b, with calt+liga on and off, and reports per face:

  1. how many sequences shape differently with the features on;

  2. how many change the glyph count — a ligature that merges characters into fewer glyphs would need multi-cell glyph placement in a terminal;

  3. how many produce an advance other than the cell (the advance of 0);

  4. how many draw ink outside a glyph's own cell, and the worst reach in cells — a renderer that clips each glyph to its cell cuts these.

Spike S3 of docs/specs/font/PLAN.md; decision FTX7 in docs/specs/font/decisions.md records the result.

Run with: dub run --single ligature-cells.d [-- font.ttf ...]

Font resolution: the arguments if given, else fc-match -f %{file} monospace. If neither yields a readable file, prints a SKIP: line and exits 0 so CI stays green.

font_libraries_ligature_cells
;
import
(package) std
std
.
(module) std.algorithm

This package implements generic algorithms oriented towards the processing of sequences. Sequences processed by these functions define range-based interfaces. See also Reference on ranges and tutorial on ranges.

Algorithms are categorized into the following submodules:

Submodule Functions

| Searching | all any balancedParens boyerMooreFinder canFind commonPrefix count countUntil endsWith find findAdjacent findAmong findSkip findSplit findSplitAfter findSplitBefore minCount maxCount minElement maxElement minIndex maxIndex minPos maxPos skipOver startsWith until |

| Comparison | among castSwitch clamp cmp either equal isPermutation isSameLength levenshteinDistance levenshteinDistanceAndPath max min mismatch predSwitch |

| Iteration | cache cacheBidirectional chunkBy cumulativeFold each filter filterBidirectional fold group joiner map mean permutations reduce splitWhen splitter substitute sum uniq |

| Sorting | completeSort isPartitioned isSorted isStrictlyMonotonic ordered strictlyOrdered makeIndex merge multiSort nextEvenPermutation nextPermutation nthPermutation partialSort partition partition3 schwartzSort sort topN topNCopy topNIndex |

| Set operations (setops) | cartesianProduct largestPartialIntersection largestPartialIntersectionWeighted multiwayMerge multiwayUnion setDifference setIntersection setSymmetricDifference |

| Mutation | bringToFront copy fill initializeAll move moveAll moveSome moveEmplace moveEmplaceAll moveEmplaceSome remove reverse strip stripLeft stripRight swap swapRanges uninitializedFill |

Many functions in this package are parameterized with a predicate. The predicate may be any suitable callable type (a function, a delegate, a functor, or a lambda), or a compile-time string. The string may consist of any legal D expression that uses the symbol a (for unary functions) or the symbols a and b (for binary functions). These names will NOT interfere with other homonym symbols in user code because they are evaluated in a different context. The default for all binary comparison predicates is "a == b" for unordered operations and "a < b" for ordered operations.

Example

int[] a = ...;
static bool greater(int a, int b)
{
    return a > b;
}
sort!greater(a);           // predicate as alias
sort!((a, b) => a > b)(a); // predicate as a lambda.
sort!"a > b"(a);           // predicate as string
                           // (no ambiguity with array name)
sort(a);                   // no predicate, "a < b" is implicit

Source

std/algorithm/package.d

@copyrightAndrei Alexandrescu 2008-.@licenseBoost License 1.0.@authorsAndrei Alexandrescu
algorithm
:
(alias template) font_libraries_ligature_cells.equal = std.algorithm.comparison.equal(alias pred = "a == b")

Compares two or more ranges for equality, as defined by predicate pred (which is == by default).

equal
,
(alias template) font_libraries_ligature_cells.filter = std.algorithm.iteration.filter(alias predicate) if (is(typeof(unaryFun!predicate)))

``filter!(predicate)(range) returns a new range containing only elements x in range for which predicate(x) returns true.

The predicate is passed to unaryFun, and can be either a string, or any callable that can be executed via pred(element).

@parampredicate Function to apply to each element of range@returnsAn input range that contains the filtered elements. If range is at least a forward range, the return value of filter will also be a forward range.@seeFilter (higher-order function), filterBidirectional
filter
,
(alias template) font_libraries_ligature_cells.map = std.algorithm.iteration.map(fun...) if (fun.length >= 1)

Implements the homonym function (also known as transform) present in many languages of functional flavor. The call ``map!(fun)(range) returns a range of which elements are obtained by applying fun(a) left to right for all elements a in range. The original ranges are not changed. Evaluation is done lazily.

@paramfun one or more transformation functions@seeMap (higher-order function)
map
,
(alias template) font_libraries_ligature_cells.max = std.algorithm.comparison.max(T...)(T args) if (T.length >= 2 && !is(CommonType!T == void))

Iterates the passed arguments and returns the maximum value.

@paramargs The values to select the maximum from. At least two arguments must be passed, and they must be comparable with <.@returnsThe maximum of the passed-in values. The type of the returned value is the type among the passed arguments that is able to store the largest value. If at least one of the arguments is NaN, the result is an unspecified value. See maxElement for examples on how to cope with NaNs.@seemaxElement
max
;
import
(package) std
std
.
(module) std.array

Functions and types that manipulate built-in arrays and associative arrays.

This module provides all kinds of functions to create, manipulate or convert arrays:

Function Name Description

| array | Returns a copy of the input in a newly allocated dynamic array. | | appender | Returns a new Appender or RefAppender initialized with a given array. | | assocArray | Returns a newly allocated associative array from a range/ranges of keys and values. | | byPair | Construct a range iterating over an associative array by key/value tuples. | | insertInPlace | Inserts into an existing array at a given position. | | join | Concatenates a range of ranges into one array. | | minimallyInitializedArray | Returns a new array of type T. | | replace | Returns a new array with all occurrences of a certain subrange replaced. | | replaceFirst | Returns a new array with the first occurrence of a certain subrange replaced. | | replaceInPlace | Replaces all occurrences of a certain subrange and puts the result into a given array. | | replaceInto | Replaces all occurrences of a certain subrange and puts the result into an output range. | | replaceLast | Returns a new array with the last occurrence of a certain subrange replaced. | | replaceSlice | Returns a new array with a given slice replaced. | | replicate | Creates a new array out of several copies of an input array or range. | | sameHead | Checks if the initial segments of two arrays refer to the same place in memory. | | sameTail | Checks if the final segments of two arrays refer to the same place in memory. | | split | Eagerly split a range or string into an array. | | staticArray | Creates a new static array from given data. | | uninitializedArray | Returns a new array of type T without initializing its elements. |

Source

std/array.d

@copyrightCopyright Andrei Alexandrescu 2008- and Jonathan M Davis 2011-.@licenseBoost License 1.0.@authorsAndrei Alexandrescu and Jonathan M Davis
array
:
(alias template) font_libraries_ligature_cells.array = std.array.array(Range)(Range r) if (isIterable!Range && !isAutodecodableString!Range && !isInfinite!Range)

Allocates an array and initializes it with copies of the elements of range r.

Narrow strings are handled as follows:

  • If autodecoding is turned on (default), then they are handled as a separate overload.

  • If autodecoding is turned off, then this is equivalent to duplicating the array.

@paramr range (or aggregate with opApply function) whose elements are copied into the allocated array@returnsallocated and initialized array
array
;
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_ligature_cells.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
;
import
(package) std
std
.
(module) std.path

This module is used to manipulate path strings.

All functions, with the exception of expandTilde (and in some cases absolutePath and relativePath), are pure string manipulation functions; they don't depend on any state outside the program, nor do they perform any actual file system actions. This has the consequence that the module does not make any distinction between a path that points to a directory and a path that points to a file, and it does not know whether or not the object pointed to by the path actually exists in the file system. To differentiate between these cases, use isDir and exists.

Note that on Windows, both the backslash (\) and the slash (/) are in principle valid directory separators. This module treats them both on equal footing, but in cases where a new separator is added, a backslash will be used. Furthermore, the buildNormalizedPath function will replace all slashes with backslashes on that platform.

In general, the functions in this module assume that the input paths are well-formed. (That is, they should not contain invalid characters, they should follow the file system's path format, etc.) The result of calling a function on an ill-formed path is undefined. When there is a chance that a path or a file name is invalid (for instance, when it has been input by the user), it may sometimes be desirable to use the isValidFilename and isValidPath functions to check this.

Most functions do not perform any memory allocations, and if a string is returned, it is usually a slice of an input string. If a function allocates, this is explicitly mentioned in the documentation.

Category Functions
Normalization absolutePath asAbsolutePath asNormalizedPath asRelativePath buildNormalizedPath buildPath chainPath expandTilde
Partitioning baseName dirName dirSeparator driveName pathSeparator pathSplitter relativePath rootName stripDrive
Validation isAbsolute isDirSeparator isRooted isValidFilename isValidPath
Extension defaultExtension extension setExtension stripExtension withDefaultExtension withExtension
Other filenameCharCmp filenameCmp globMatch CaseSensitive

Source

std/path.d

@authorsLars Tandle Kyllingstad, Walter Bright, Grzegorz Adam Hankiewicz, Thomas Khne, Andrei Alexandrescu@copyrightCopyright (c) 2000-2014, the authors. All rights reserved.@licenseBoost License 1.0
path
:
(alias template) font_libraries_ligature_cells.baseName = std.path.baseName(R)(return scope R path) if (isRandomAccessRange!R && hasSlicing!R && isSomeChar!(ElementType!R) && !isSomeString!R)

Note

This function only strips away the specified suffix, which doesn't necessarily have to represent an extension. To remove the extension from a path, regardless of what the extension is, use stripExtension. To obtain the filename without leading directories and without an extension, combine the functions like this:

assert(baseName(stripExtension("dir/file.ext")) == "file");
@paramcs Whether or not suffix matching is case-sensitive.@parampath A path name. It can be a string, or any random-access range of characters.@paramsuffix An optional suffix to be removed from the file name.@returns

The name of the file in the path name, without any leading directory and with an optional suffix chopped off.

If suffix is specified, it will be compared to path using filenameCmp!cs, where cs is an optional template parameter determining whether the comparison is case sensitive or not. See the filenameCmp documentation for details.

@standardsThis function complies with the POSIX requirements for the 'basename' shell utility (with suitable adaptations for Windows paths).
baseName
;
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_ligature_cells.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.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_ligature_cells.writefln = std.stdio.writefln(alias fmt, A...)(A args) if (isSomeString!(typeof(fmt)))

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

writefln
,
(alias template) font_libraries_ligature_cells.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
;
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_ligature_cells.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
,
(alias) font_libraries_ligature_cells.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
;
import
(package) std
std
.
(module) std.utf

Encode and decode UTF-8, UTF-16 and UTF-32 strings.

UTF character support is restricted to '\u0000' &lt;= character &lt;= '\U0010FFFF'.

Category Functions
Decode decode decodeFront
Lazy decode byCodeUnit byChar byWchar byDchar byUTF
Encode encode toUTF8 toUTF16 toUTF32 toUTFz toUTF16z
Length codeLength count stride strideBack
Index toUCSindex toUTFindex
Validation isValidDchar isValidCodepoint validate
Miscellaneous replacementDchar UseReplacementDchar UTFException

Source

std/utf.d

utf
:
(alias template) font_libraries_ligature_cells.count = std.utf.count(C)(const(C)[] str) if (isSomeChar!C)

Returns the total number of code points encoded in str.

Supercedes

This function supercedes toUCSindex.

@standardsUnicode 5.0, ASCII, ISO-8859-1, WINDOWS-1252@throwsUTFException if str is not well-formed.
count
;
// --------------------------------------------------------------------------- // HarfBuzz C ABI, the subset this program needs. Layouts follow hb-common.h, // hb-buffer.h and hb-font.h: every field is a 32-bit scalar. // --------------------------------------------------------------------------- extern (C) nothrow @nogc { struct
(struct) font_libraries_ligature_cells.hb_blob_t
hb_blob_t
;
struct
(struct) font_libraries_ligature_cells.hb_face_t
hb_face_t
;
struct
(struct) font_libraries_ligature_cells.hb_font_t
hb_font_t
;
struct
(struct) font_libraries_ligature_cells.hb_buffer_t
hb_buffer_t
;
alias
(alias) font_libraries_ligature_cells.hb_codepoint_t = uint
hb_codepoint_t
= uint;
alias
(alias) font_libraries_ligature_cells.hb_position_t = int
hb_position_t
= int;
alias
(alias) font_libraries_ligature_cells.hb_tag_t = uint
hb_tag_t
= uint;
alias
(alias) font_libraries_ligature_cells.hb_bool_t = int
hb_bool_t
= int;
struct
(struct) font_libraries_ligature_cells.hb_glyph_info_t
hb_glyph_info_t
{
(alias) font_libraries_ligature_cells.hb_codepoint_t = uint
hb_codepoint_t
(field) uint font_libraries_ligature_cells.hb_glyph_info_t.codepoint
codepoint
; // glyph id after shaping
uint
(field) uint font_libraries_ligature_cells.hb_glyph_info_t.mask
mask
;
uint
(field) uint font_libraries_ligature_cells.hb_glyph_info_t.cluster
cluster
;
uint
(field) uint font_libraries_ligature_cells.hb_glyph_info_t.var1
var1
,
(field) uint font_libraries_ligature_cells.hb_glyph_info_t.var2
var2
; // private
} struct
(struct) font_libraries_ligature_cells.hb_glyph_position_t
hb_glyph_position_t
{
(alias) font_libraries_ligature_cells.hb_position_t = int
hb_position_t
(field) int font_libraries_ligature_cells.hb_glyph_position_t.x_advance
x_advance
,
(field) int font_libraries_ligature_cells.hb_glyph_position_t.y_advance
y_advance
,
(field) int font_libraries_ligature_cells.hb_glyph_position_t.x_offset
x_offset
,
(field) int font_libraries_ligature_cells.hb_glyph_position_t.y_offset
y_offset
;
uint
(field) uint font_libraries_ligature_cells.hb_glyph_position_t.var
var
; // private
} struct
(struct) font_libraries_ligature_cells.hb_feature_t
hb_feature_t
{
(alias) font_libraries_ligature_cells.hb_tag_t = uint
hb_tag_t
(field) uint font_libraries_ligature_cells.hb_feature_t.tag
tag
;
uint
(field) uint font_libraries_ligature_cells.hb_feature_t.value
value
;
uint
(field) uint font_libraries_ligature_cells.hb_feature_t.start
start
,
(field) uint font_libraries_ligature_cells.hb_feature_t.end
end
;
} struct
(struct) font_libraries_ligature_cells.hb_glyph_extents_t
hb_glyph_extents_t
{
(alias) font_libraries_ligature_cells.hb_position_t = int
hb_position_t
(field) int font_libraries_ligature_cells.hb_glyph_extents_t.x_bearing
x_bearing
,
(field) int font_libraries_ligature_cells.hb_glyph_extents_t.y_bearing
y_bearing
,
(field) int font_libraries_ligature_cells.hb_glyph_extents_t.width
width
,
(field) int font_libraries_ligature_cells.hb_glyph_extents_t.height
height
;
}
(struct) font_libraries_ligature_cells.hb_blob_t
hb_blob_t
*
font_libraries_ligature_cells.hb_blob_t* font_libraries_ligature_cells.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_ligature_cells.hb_blob_destroy(font_libraries_ligature_cells.hb_blob_t*) nothrow @nogc
hb_blob_destroy
(
(struct) font_libraries_ligature_cells.hb_blob_t
hb_blob_t
*);
uint
uint font_libraries_ligature_cells.hb_blob_get_length(font_libraries_ligature_cells.hb_blob_t*) nothrow @nogc
hb_blob_get_length
(
(struct) font_libraries_ligature_cells.hb_blob_t
hb_blob_t
*);
(struct) font_libraries_ligature_cells.hb_face_t
hb_face_t
*
font_libraries_ligature_cells.hb_face_t* font_libraries_ligature_cells.hb_face_create(font_libraries_ligature_cells.hb_blob_t*, uint index) nothrow @nogc
hb_face_create
(
(struct) font_libraries_ligature_cells.hb_blob_t
hb_blob_t
*, uint
(parameter) uint index
index
);
void
void font_libraries_ligature_cells.hb_face_destroy(font_libraries_ligature_cells.hb_face_t*) nothrow @nogc
hb_face_destroy
(
(struct) font_libraries_ligature_cells.hb_face_t
hb_face_t
*);
uint
uint font_libraries_ligature_cells.hb_face_get_upem(const(font_libraries_ligature_cells.hb_face_t)*) nothrow @nogc
hb_face_get_upem
(const(
(struct) font_libraries_ligature_cells.hb_face_t
hb_face_t
)*);
(struct) font_libraries_ligature_cells.hb_font_t
hb_font_t
*
font_libraries_ligature_cells.hb_font_t* font_libraries_ligature_cells.hb_font_create(font_libraries_ligature_cells.hb_face_t*) nothrow @nogc
hb_font_create
(
(struct) font_libraries_ligature_cells.hb_face_t
hb_face_t
*);
void
void font_libraries_ligature_cells.hb_font_destroy(font_libraries_ligature_cells.hb_font_t*) nothrow @nogc
hb_font_destroy
(
(struct) font_libraries_ligature_cells.hb_font_t
hb_font_t
*);
void
void font_libraries_ligature_cells.hb_ot_font_set_funcs(font_libraries_ligature_cells.hb_font_t*) nothrow @nogc
hb_ot_font_set_funcs
(
(struct) font_libraries_ligature_cells.hb_font_t
hb_font_t
*);
void
void font_libraries_ligature_cells.hb_font_set_scale(font_libraries_ligature_cells.hb_font_t*, int x_scale, int y_scale) nothrow @nogc
hb_font_set_scale
(
(struct) font_libraries_ligature_cells.hb_font_t
hb_font_t
*, int
(parameter) int x_scale
x_scale
, int
(parameter) int y_scale
y_scale
);
(alias) font_libraries_ligature_cells.hb_bool_t = int
hb_bool_t
int font_libraries_ligature_cells.hb_font_get_glyph_extents(font_libraries_ligature_cells.hb_font_t*, uint glyph, font_libraries_ligature_cells.hb_glyph_extents_t* extents) nothrow @nogc
hb_font_get_glyph_extents
(
(struct) font_libraries_ligature_cells.hb_font_t
hb_font_t
*,
(alias) font_libraries_ligature_cells.hb_codepoint_t = uint
hb_codepoint_t
(parameter) uint glyph
glyph
,
(struct) font_libraries_ligature_cells.hb_glyph_extents_t
hb_glyph_extents_t
*
(parameter) font_libraries_ligature_cells.hb_glyph_extents_t* extents
extents
);
(struct) font_libraries_ligature_cells.hb_buffer_t
hb_buffer_t
*
font_libraries_ligature_cells.hb_buffer_t* font_libraries_ligature_cells.hb_buffer_create() nothrow @nogc
hb_buffer_create
();
void
void font_libraries_ligature_cells.hb_buffer_destroy(font_libraries_ligature_cells.hb_buffer_t*) nothrow @nogc
hb_buffer_destroy
(
(struct) font_libraries_ligature_cells.hb_buffer_t
hb_buffer_t
*);
void
void font_libraries_ligature_cells.hb_buffer_add_utf8(font_libraries_ligature_cells.hb_buffer_t*, const(char)* text, int text_length, uint item_offset, int item_length) nothrow @nogc
hb_buffer_add_utf8
(
(struct) font_libraries_ligature_cells.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_ligature_cells.hb_buffer_guess_segment_properties(font_libraries_ligature_cells.hb_buffer_t*) nothrow @nogc
hb_buffer_guess_segment_properties
(
(struct) font_libraries_ligature_cells.hb_buffer_t
hb_buffer_t
*);
(struct) font_libraries_ligature_cells.hb_glyph_info_t
hb_glyph_info_t
*
font_libraries_ligature_cells.hb_glyph_info_t* font_libraries_ligature_cells.hb_buffer_get_glyph_infos(font_libraries_ligature_cells.hb_buffer_t*, uint* length) nothrow @nogc
hb_buffer_get_glyph_infos
(
(struct) font_libraries_ligature_cells.hb_buffer_t
hb_buffer_t
*, uint*
(parameter) uint* length
length
);
(struct) font_libraries_ligature_cells.hb_glyph_position_t
hb_glyph_position_t
*
font_libraries_ligature_cells.hb_glyph_position_t* font_libraries_ligature_cells.hb_buffer_get_glyph_positions(font_libraries_ligature_cells.hb_buffer_t*, uint* length) nothrow @nogc
hb_buffer_get_glyph_positions
(
(struct) font_libraries_ligature_cells.hb_buffer_t
hb_buffer_t
*, uint*
(parameter) uint* length
length
);
void
void font_libraries_ligature_cells.hb_shape(font_libraries_ligature_cells.hb_font_t*, font_libraries_ligature_cells.hb_buffer_t*, const(font_libraries_ligature_cells.hb_feature_t)* features, uint num_features) nothrow @nogc
hb_shape
(
(struct) font_libraries_ligature_cells.hb_font_t
hb_font_t
*,
(struct) font_libraries_ligature_cells.hb_buffer_t
hb_buffer_t
*, const(
(struct) font_libraries_ligature_cells.hb_feature_t
hb_feature_t
)*
(parameter) const(font_libraries_ligature_cells.hb_feature_t)* features
features
, uint
(parameter) uint num_features
num_features
);
} // extern (C) /// `HB_TAG('c','a','l','t')` as a D function: big-endian packed ASCII.
(alias) font_libraries_ligature_cells.hb_tag_t = uint
hb_tag_t
uint font_libraries_ligature_cells.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 union of four fonts' ligature inventories, plus Latin `liga` pairs. immutable
(alias) object.string = string
string
[]
(immutable global) immutable(string[]) font_libraries_ligature_cells.corpus

The union of four fonts' ligature inventories, plus Latin liga pairs.

corpus
= [
"->", "-->", "<-", "<--", "<->", "=>", "==>", "<=", ">=", "<=>", "<==>", "!=", "!==", "==", "===", "=/=", "/=", "&&", "||", "|||", "::", ":::", ":=", "::=", "=:", "?:", "?.", "??", "?=", "!!", "..", "...", "..<", "..=", ".=", ".-", ".?", "++", "+++", "--", "---", "**", "***", "//", "///", "/*", "*/", "/**", "<!--", "<!---", "|>", "<|", "<|>", "||>", "<||", "|=", "|-", "-|", "~>", "<~", "~~", "~~>", "~-", "-~", "~@", "<<", "<<<", ">>", ">>>", "<<=", ">>=", ">>-", "-<<", "<*", "*>", "<*>", "<$", "$>", "<$>", "<+", "+>", "<+>", "</", "/>", "</>", "#{", "#[", "#(", "#?", "#!", "#_", "#_(", "#:", "#=", "##", "###", "####", "]#", "{|", "|}", "[|", "|]", "%%", "^=", "=<<", ">=>", "<=<", "=!=", "<<-", "->>", "=>>", "<<~", "~~~", ";;", ";;;", "__", "___", "0x", "0xFF", "1x2", "www", "ff", "fi", "fl", "ffi", "ffl", "Fl", "Tl", "Il", `\\`, `\n`, "[INFO]", "[ERROR]", "[TODO]", "todo))", "fixme))", ">-", "-<", "<:", ":>", "<:<", ">:", ":<", "=~", "!~", "|||>", "<|||", "<!", "!>", "&=", "%=", "$(", "@_", "_|_", "-->>", "=>=", "<===", "===>", "<-<", ">->", ]; struct
(struct) font_libraries_ligature_cells.Shaped
Shaped
{
(struct) font_libraries_ligature_cells.hb_glyph_info_t
hb_glyph_info_t
[]
(field) font_libraries_ligature_cells.hb_glyph_info_t[] font_libraries_ligature_cells.Shaped.infos
infos
;
(struct) font_libraries_ligature_cells.hb_glyph_position_t
hb_glyph_position_t
[]
(field) font_libraries_ligature_cells.hb_glyph_position_t[] font_libraries_ligature_cells.Shaped.positions
positions
;
}
(struct) font_libraries_ligature_cells.Shaped
Shaped
font_libraries_ligature_cells.Shaped font_libraries_ligature_cells.shape(font_libraries_ligature_cells.hb_font_t* font, string text, const(font_libraries_ligature_cells.hb_feature_t)[] features) @trusted
shape
(
(struct) font_libraries_ligature_cells.hb_font_t
hb_font_t
*
(parameter) font_libraries_ligature_cells.hb_font_t* font
font
,
(alias) object.string = string
string
(parameter) string text
text
, const(
(struct) font_libraries_ligature_cells.hb_feature_t
hb_feature_t
)[]
(parameter) const(font_libraries_ligature_cells.hb_feature_t)[] features
features
) @trusted
{ auto
(local variable) font_libraries_ligature_cells.hb_buffer_t* buf
buf
=
font_libraries_ligature_cells.hb_buffer_t* font_libraries_ligature_cells.hb_buffer_create() nothrow @nogc
hb_buffer_create
();
scope (exit)
void font_libraries_ligature_cells.hb_buffer_destroy(font_libraries_ligature_cells.hb_buffer_t*) nothrow @nogc
hb_buffer_destroy
(
(local variable) font_libraries_ligature_cells.hb_buffer_t* buf
buf
);
void font_libraries_ligature_cells.hb_buffer_add_utf8(font_libraries_ligature_cells.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_ligature_cells.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_ligature_cells.hb_buffer_guess_segment_properties(font_libraries_ligature_cells.hb_buffer_t*) nothrow @nogc
hb_buffer_guess_segment_properties
(
(local variable) font_libraries_ligature_cells.hb_buffer_t* buf
buf
);
void font_libraries_ligature_cells.hb_shape(font_libraries_ligature_cells.hb_font_t*, font_libraries_ligature_cells.hb_buffer_t*, const(font_libraries_ligature_cells.hb_feature_t)* features, uint num_features) nothrow @nogc
hb_shape
(
(parameter) font_libraries_ligature_cells.hb_font_t* font
font
,
(local variable) font_libraries_ligature_cells.hb_buffer_t* buf
buf
,
(parameter) const(font_libraries_ligature_cells.hb_feature_t)[] features
features
.
(field) const(font_libraries_ligature_cells.hb_feature_t)* const(font_libraries_ligature_cells.hb_feature_t)[].ptr
ptr
, cast(uint)
(parameter) const(font_libraries_ligature_cells.hb_feature_t)[] features
features
.
(field) ulong const(font_libraries_ligature_cells.hb_feature_t)[].length
length
);
uint
(local variable) uint n
n
;
auto
(local variable) font_libraries_ligature_cells.hb_glyph_info_t[] infos
infos
=
font_libraries_ligature_cells.hb_glyph_info_t* font_libraries_ligature_cells.hb_buffer_get_glyph_infos(font_libraries_ligature_cells.hb_buffer_t*, uint* length) nothrow @nogc
hb_buffer_get_glyph_infos
(
(local variable) font_libraries_ligature_cells.hb_buffer_t* buf
buf
, &
(local variable) uint n
n
)[0 ..
(local variable) uint n
n
].
font_libraries_ligature_cells.hb_glyph_info_t[] object.dup!(font_libraries_ligature_cells.hb_glyph_info_t)(const(font_libraries_ligature_cells.hb_glyph_info_t)[] a) pure nothrow @property @safe
dup
;
auto
(local variable) font_libraries_ligature_cells.hb_glyph_position_t[] positions
positions
=
font_libraries_ligature_cells.hb_glyph_position_t* font_libraries_ligature_cells.hb_buffer_get_glyph_positions(font_libraries_ligature_cells.hb_buffer_t*, uint* length) nothrow @nogc
hb_buffer_get_glyph_positions
(
(local variable) font_libraries_ligature_cells.hb_buffer_t* buf
buf
, &
(local variable) uint n
n
)[0 ..
(local variable) uint n
n
].
font_libraries_ligature_cells.hb_glyph_position_t[] object.dup!(font_libraries_ligature_cells.hb_glyph_position_t)(const(font_libraries_ligature_cells.hb_glyph_position_t)[] a) pure nothrow @property @safe
dup
;
return
(struct) font_libraries_ligature_cells.Shaped
Shaped
(
(local variable) font_libraries_ligature_cells.hb_glyph_info_t[] infos
infos
,
(local variable) font_libraries_ligature_cells.hb_glyph_position_t[] positions
positions
);
} /// How far, in font units, a glyph's ink reaches outside `[0, cell)`. int
int font_libraries_ligature_cells.spill(font_libraries_ligature_cells.hb_font_t* font, font_libraries_ligature_cells.hb_glyph_info_t info, font_libraries_ligature_cells.hb_glyph_position_t pos, int cell) @trusted

How far, in font units, a glyph's ink reaches outside [0, cell).

spill
(
(struct) font_libraries_ligature_cells.hb_font_t
hb_font_t
*
(parameter) font_libraries_ligature_cells.hb_font_t* font
font
,
(struct) font_libraries_ligature_cells.hb_glyph_info_t
hb_glyph_info_t
(parameter) font_libraries_ligature_cells.hb_glyph_info_t info
info
,
(struct) font_libraries_ligature_cells.hb_glyph_position_t
hb_glyph_position_t
(parameter) font_libraries_ligature_cells.hb_glyph_position_t pos
pos
, int
(parameter) int cell
cell
) @trusted
{
(struct) font_libraries_ligature_cells.hb_glyph_extents_t
hb_glyph_extents_t
(local variable) font_libraries_ligature_cells.hb_glyph_extents_t e
e
;
if (!
int font_libraries_ligature_cells.hb_font_get_glyph_extents(font_libraries_ligature_cells.hb_font_t*, uint glyph, font_libraries_ligature_cells.hb_glyph_extents_t* extents) nothrow @nogc
hb_font_get_glyph_extents
(
(parameter) font_libraries_ligature_cells.hb_font_t* font
font
,
(parameter) font_libraries_ligature_cells.hb_glyph_info_t info
info
.
(field) uint font_libraries_ligature_cells.hb_glyph_info_t.codepoint
codepoint
, &
(local variable) font_libraries_ligature_cells.hb_glyph_extents_t e
e
) ||
(local variable) font_libraries_ligature_cells.hb_glyph_extents_t e
e
.
(field) int font_libraries_ligature_cells.hb_glyph_extents_t.width
width
== 0)
return 0; const
(local variable) const(int) left
left
=
(parameter) font_libraries_ligature_cells.hb_glyph_position_t pos
pos
.
(field) int font_libraries_ligature_cells.hb_glyph_position_t.x_offset
x_offset
+
(local variable) font_libraries_ligature_cells.hb_glyph_extents_t e
e
.
(field) int font_libraries_ligature_cells.hb_glyph_extents_t.x_bearing
x_bearing
;
return
int std.algorithm.comparison.max!(int, const(int), int)(int __param_0, const(int) __param_1, int __param_2) pure nothrow @nogc @safe

Iterates the passed arguments and returns the maximum value.

@paramargs The values to select the maximum from. At least two arguments must be passed, and they must be comparable with <.@returnsThe maximum of the passed-in values. The type of the returned value is the type among the passed arguments that is able to store the largest value. If at least one of the arguments is NaN, the result is an unspecified value. See maxElement for examples on how to cope with NaNs.@seemaxElement
max
(0, -
(local variable) const(int) left
left
,
(local variable) const(int) left
left
+
(local variable) font_libraries_ligature_cells.hb_glyph_extents_t e
e
.
(field) int font_libraries_ligature_cells.hb_glyph_extents_t.width
width
-
(parameter) int cell
cell
);
} void
void font_libraries_ligature_cells.measure(string path) @trusted
measure
(
(alias) object.string = string
string
(parameter) string path
path
) @trusted
{ auto
(local variable) font_libraries_ligature_cells.hb_blob_t* blob
blob
=
font_libraries_ligature_cells.hb_blob_t* font_libraries_ligature_cells.hb_blob_create_from_file(const(char)* file_name) nothrow @nogc
hb_blob_create_from_file
(
(parameter) 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_ligature_cells.hb_blob_destroy(font_libraries_ligature_cells.hb_blob_t*) nothrow @nogc
hb_blob_destroy
(
(local variable) font_libraries_ligature_cells.hb_blob_t* blob
blob
);
if (
uint font_libraries_ligature_cells.hb_blob_get_length(font_libraries_ligature_cells.hb_blob_t*) nothrow @nogc
hb_blob_get_length
(
(local variable) font_libraries_ligature_cells.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 ",
(parameter) string path
path
);
return; } auto
(local variable) font_libraries_ligature_cells.hb_face_t* face
face
=
font_libraries_ligature_cells.hb_face_t* font_libraries_ligature_cells.hb_face_create(font_libraries_ligature_cells.hb_blob_t*, uint index) nothrow @nogc
hb_face_create
(
(local variable) font_libraries_ligature_cells.hb_blob_t* blob
blob
, 0);
scope (exit)
void font_libraries_ligature_cells.hb_face_destroy(font_libraries_ligature_cells.hb_face_t*) nothrow @nogc
hb_face_destroy
(
(local variable) font_libraries_ligature_cells.hb_face_t* face
face
);
auto
(local variable) font_libraries_ligature_cells.hb_font_t* font
font
=
font_libraries_ligature_cells.hb_font_t* font_libraries_ligature_cells.hb_font_create(font_libraries_ligature_cells.hb_face_t*) nothrow @nogc
hb_font_create
(
(local variable) font_libraries_ligature_cells.hb_face_t* face
face
);
scope (exit)
void font_libraries_ligature_cells.hb_font_destroy(font_libraries_ligature_cells.hb_font_t*) nothrow @nogc
hb_font_destroy
(
(local variable) font_libraries_ligature_cells.hb_font_t* font
font
);
void font_libraries_ligature_cells.hb_ot_font_set_funcs(font_libraries_ligature_cells.hb_font_t*) nothrow @nogc
hb_ot_font_set_funcs
(
(local variable) font_libraries_ligature_cells.hb_font_t* font
font
);
const
(local variable) const(uint) upem
upem
=
uint font_libraries_ligature_cells.hb_face_get_upem(const(font_libraries_ligature_cells.hb_face_t)*) nothrow @nogc
hb_face_get_upem
(
(local variable) font_libraries_ligature_cells.hb_face_t* face
face
);
void font_libraries_ligature_cells.hb_font_set_scale(font_libraries_ligature_cells.hb_font_t*, int x_scale, int y_scale) nothrow @nogc
hb_font_set_scale
(
(local variable) font_libraries_ligature_cells.hb_font_t* font
font
,
(local variable) const(uint) upem
upem
,
(local variable) const(uint) upem
upem
); // design units
const
(local variable) const(int) cell
cell
=
font_libraries_ligature_cells.Shaped font_libraries_ligature_cells.shape(font_libraries_ligature_cells.hb_font_t* font, string text, const(font_libraries_ligature_cells.hb_feature_t)[] features) @trusted
shape
(
(local variable) font_libraries_ligature_cells.hb_font_t* font
font
, "0", null).
(field) font_libraries_ligature_cells.hb_glyph_position_t[] font_libraries_ligature_cells.Shaped.positions
positions
[0].
(field) int font_libraries_ligature_cells.hb_glyph_position_t.x_advance
x_advance
;
const
(local variable) const(font_libraries_ligature_cells.hb_feature_t[]) on
on
= [
(struct) font_libraries_ligature_cells.hb_feature_t
hb_feature_t
(
uint font_libraries_ligature_cells.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_ligature_cells.hb_feature_t
hb_feature_t
(
uint font_libraries_ligature_cells.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_ligature_cells.hb_feature_t[]) off
off
= [
(struct) font_libraries_ligature_cells.hb_feature_t
hb_feature_t
(
uint font_libraries_ligature_cells.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_ligature_cells.hb_feature_t
hb_feature_t
(
uint font_libraries_ligature_cells.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
)];
(alias) object.size_t = ulong
size_t
(local variable) ulong changed
changed
,
(local variable) ulong countChanged
countChanged
,
(local variable) ulong offGrid
offGrid
,
(local variable) ulong spilled
spilled
;
int
(local variable) int worst
worst
;
(alias) object.string = string
string
(local variable) string worstSeq
worstSeq
;
foreach (
(parameter) immutable(string) seq
seq
;
(immutable global) immutable(string[]) font_libraries_ligature_cells.corpus

The union of four fonts' ligature inventories, plus Latin liga pairs.

corpus
)
{ const
(local variable) const(string) text
text
= "a" ~
(local variable) immutable(string) seq
seq
~ "b";
const
(local variable) const(font_libraries_ligature_cells.Shaped) a
a
=
font_libraries_ligature_cells.Shaped font_libraries_ligature_cells.shape(font_libraries_ligature_cells.hb_font_t* font, string text, const(font_libraries_ligature_cells.hb_feature_t)[] features) @trusted
shape
(
(local variable) font_libraries_ligature_cells.hb_font_t* font
font
,
(local variable) const(string) text
text
,
(local variable) const(font_libraries_ligature_cells.hb_feature_t[]) on
on
),
(local variable) const(font_libraries_ligature_cells.Shaped) b
b
=
font_libraries_ligature_cells.Shaped font_libraries_ligature_cells.shape(font_libraries_ligature_cells.hb_font_t* font, string text, const(font_libraries_ligature_cells.hb_feature_t)[] features) @trusted
shape
(
(local variable) font_libraries_ligature_cells.hb_font_t* font
font
,
(local variable) const(string) text
text
,
(local variable) const(font_libraries_ligature_cells.hb_feature_t[]) off
off
);
if (
(local variable) const(font_libraries_ligature_cells.Shaped) a
a
.
(field) font_libraries_ligature_cells.hb_glyph_info_t[] font_libraries_ligature_cells.Shaped.infos
infos
.
(field) ulong const(font_libraries_ligature_cells.hb_glyph_info_t[]).length
length
!=
(local variable) const(string) text
text
.
ulong std.utf.count!char(const(char)[] str) pure nothrow @nogc @safe

Returns the total number of code points encoded in str.

Supercedes

This function supercedes toUCSindex.

Examples

assert(count("") == 0);
assert(count("a") == 1);
assert(count("abc") == 3);
assert(count("\u20AC100") == 4);
@standardsUnicode 5.0, ASCII, ISO-8859-1, WINDOWS-1252@throwsUTFException if str is not well-formed.
count
)
++
(local variable) ulong countChanged
countChanged
;
if (
(local variable) const(font_libraries_ligature_cells.Shaped) a
a
.
(field) font_libraries_ligature_cells.hb_glyph_position_t[] font_libraries_ligature_cells.Shaped.positions
positions
.
font_libraries_ligature_cells.measure.MapResult!(__lambda_L195_C30, const(hb_glyph_position_t)[]) font_libraries_ligature_cells.measure.map!(const(font_libraries_ligature_cells.hb_glyph_position_t)[])(const(font_libraries_ligature_cells.hb_glyph_position_t)[] r) pure nothrow @nogc @safe

Implements the homonym function (also known as transform) present in many languages of functional flavor. The call ``map!(fun)(range) returns a range of which elements are obtained by applying fun(a) left to right for all elements a in range. The original ranges are not changed. Evaluation is done lazily.

Examples

import std.algorithm.comparison : equal;
import std.range : chain, only;
auto squares =
    chain(only(1, 2, 3, 4), only(5, 6)).map!(a => a * a);
assert(equal(squares, only(1, 4, 9, 16, 25, 36)));

Multiple functions can be passed to map. In that case, the element type of map is a tuple containing one element for each function.

auto sums = [2, 4, 6, 8];
auto products = [1, 4, 9, 16];

size_t i = 0;
foreach (result; [ 1, 2, 3, 4 ].map!("a + a", "a * a"))
{
    assert(result[0] == sums[i]);
    assert(result[1] == products[i]);
    ++i;
}

You may alias map with some function(s) to a symbol and use it separately:

import std.algorithm.comparison : equal;
import std.conv : to;

alias stringize = map!(to!string);
assert(equal(stringize([ 1, 2, 3, 4 ]), [ "1", "2", "3", "4" ]));
@paramfun one or more transformation functions@seeMap (higher-order function)@paramr an input range@returnsA range with each fun applied to all the elements. If there is more than one fun, the element type will be Tuple containing one element for each fun.
map
!(p => p.x_advance).
font_libraries_ligature_cells.measure.FilterResult!(__lambda_L195_C56, MapResult!(__lambda_L195_C30, const(hb_glyph_position_t)[])) font_libraries_ligature_cells.measure.filter!(font_libraries_ligature_cells.measure.MapResult!(__lambda_L195_C30, const(hb_glyph_position_t)[]))(font_libraries_ligature_cells.measure.MapResult!(__lambda_L195_C30, const(hb_glyph_position_t)[]) range) pure nothrow @nogc @safe

filter`!(predicate)(`range`)` returns a new `range` containing only elements `x` in range`` for which predicate(x) returns true.

The predicate is passed to unaryFun, and can be either a string, or any callable that can be executed via pred(element).

Examples

import std.algorithm.comparison : equal;
import std.math.operations : isClose;
import std.range;

int[] arr = [ 1, 2, 3, 4, 5 ];

// Filter below 3
auto small = filter!(a => a < 3)(arr);
assert(equal(small, [ 1, 2 ]));

// Filter again, but with Uniform Function Call Syntax (UFCS)
auto sum = arr.filter!(a => a < 3);
assert(equal(sum, [ 1, 2 ]));

// In combination with chain() to span multiple ranges
int[] a = [ 3, -2, 400 ];
int[] b = [ 100, -101, 102 ];
auto r = chain(a, b).filter!(a => a > 0);
assert(equal(r, [ 3, 400, 100, 102 ]));

// Mixing convertible types is fair game, too
double[] c = [ 2.5, 3.0 ];
auto r1 = chain(c, a, b).filter!(a => cast(int) a != a);
assert(isClose(r1, [ 2.5 ]));
@parampredicate Function to apply to each element of range@returnsAn input range that contains the filtered elements. If range is at least a forward range, the return value of filter will also be a forward range.@seeFilter (higher-order function), filterBidirectional@paramrange An input range of elements@returnsA range containing only elements x in range for which predicate(x) returns true.
filter
!(x => x != cell).
const(int)[] std.array.array!(font_libraries_ligature_cells.measure.FilterResult!(__lambda_L195_C56, MapResult!(__lambda_L195_C30, const(hb_glyph_position_t)[])))(font_libraries_ligature_cells.measure.FilterResult!(__lambda_L195_C56, MapResult!(__lambda_L195_C30, const(hb_glyph_position_t)[])) r) pure nothrow @safe

Allocates an array and initializes it with copies of the elements of range r.

Narrow strings are handled as follows:

  • If autodecoding is turned on (default), then they are handled as a separate overload.

  • If autodecoding is turned off, then this is equivalent to duplicating the array.

@paramr range (or aggregate with opApply function) whose elements are copied into the allocated array@returnsallocated and initialized array
array
.
(field) ulong const(int)[].length
length
)
++
(local variable) ulong offGrid
offGrid
;
if (
bool std.algorithm.comparison.equal!().equal!(font_libraries_ligature_cells.measure.MapResult!(__lambda_L197_C32, const(hb_glyph_info_t)[]), font_libraries_ligature_cells.measure.MapResult!(__lambda_L197_C64, const(hb_glyph_info_t)[]))(font_libraries_ligature_cells.measure.MapResult!(__lambda_L197_C32, const(hb_glyph_info_t)[]) __param_0, font_libraries_ligature_cells.measure.MapResult!(__lambda_L197_C64, const(hb_glyph_info_t)[]) __param_1) pure nothrow @nogc @safe

Compares two or more ranges for equality, as defined by predicate pred (which is == by default).

Compares two or more ranges for equality. The ranges may have different element types, as long as all are comparable by means of the pred. Performs O(min(rs[0].length, rs[1].length, ...)) evaluations of pred. However, if equal is invoked with the default predicate, the implementation may take the liberty to use faster implementations that have the theoretical worst-case O(max(rs[0].length, rs[1].length, ...)).

At least one of the ranges must be finite. If one range involved is infinite, the result is (statically known to be) false.

If the ranges have different kinds of UTF code unit (char, wchar, or dchar), then they are compared using UTF decoding to avoid accidentally integer-promoting units.

Examples

import std.algorithm.comparison : equal;
import std.math.operations : isClose;

int[4] a = [ 1, 2, 4, 3 ];
assert(!equal(a[], a[1..$]));
assert(equal(a[], a[]));
assert(equal!((a, b) => a == b)(a[], a[]));

// different types
double[4] b = [ 1.0, 2, 4, 3];
assert(!equal(a[], b[1..$]));
assert(equal(a[], b[]));

// predicated: ensure that two vectors are approximately equal
double[4] c = [ 1.0000000005, 2, 4, 3];
assert(equal!isClose(b[], c[]));

Tip

equal can itself be used as a predicate to other functions. This can be very useful when the element type of a range is itself a range. In particular, equal can be its own predicate, allowing range of range (of range...) comparisons.

import std.algorithm.comparison : equal;
import std.range : iota, chunks;
assert(equal!(equal!equal)(
    [[[0, 1], [2, 3]], [[4, 5], [6, 7]]],
    iota(0, 8).chunks(2).chunks(2)
));
@paramrs The ranges to be compared.@returnstrue if and only if all ranges compare equal element for element, according to binary predicate pred.
equal
(
(local variable) const(font_libraries_ligature_cells.Shaped) a
a
.
(field) font_libraries_ligature_cells.hb_glyph_info_t[] font_libraries_ligature_cells.Shaped.infos
infos
.
font_libraries_ligature_cells.measure.MapResult!(__lambda_L197_C32, const(hb_glyph_info_t)[]) font_libraries_ligature_cells.measure.map!(const(font_libraries_ligature_cells.hb_glyph_info_t)[])(const(font_libraries_ligature_cells.hb_glyph_info_t)[] r) pure nothrow @nogc @safe

Implements the homonym function (also known as transform) present in many languages of functional flavor. The call ``map!(fun)(range) returns a range of which elements are obtained by applying fun(a) left to right for all elements a in range. The original ranges are not changed. Evaluation is done lazily.

Examples

import std.algorithm.comparison : equal;
import std.range : chain, only;
auto squares =
    chain(only(1, 2, 3, 4), only(5, 6)).map!(a => a * a);
assert(equal(squares, only(1, 4, 9, 16, 25, 36)));

Multiple functions can be passed to map. In that case, the element type of map is a tuple containing one element for each function.

auto sums = [2, 4, 6, 8];
auto products = [1, 4, 9, 16];

size_t i = 0;
foreach (result; [ 1, 2, 3, 4 ].map!("a + a", "a * a"))
{
    assert(result[0] == sums[i]);
    assert(result[1] == products[i]);
    ++i;
}

You may alias map with some function(s) to a symbol and use it separately:

import std.algorithm.comparison : equal;
import std.conv : to;

alias stringize = map!(to!string);
assert(equal(stringize([ 1, 2, 3, 4 ]), [ "1", "2", "3", "4" ]));
@paramfun one or more transformation functions@seeMap (higher-order function)@paramr an input range@returnsA range with each fun applied to all the elements. If there is more than one fun, the element type will be Tuple containing one element for each fun.
map
!(i => i.codepoint),
(local variable) const(font_libraries_ligature_cells.Shaped) b
b
.
(field) font_libraries_ligature_cells.hb_glyph_info_t[] font_libraries_ligature_cells.Shaped.infos
infos
.
font_libraries_ligature_cells.measure.MapResult!(__lambda_L197_C64, const(hb_glyph_info_t)[]) font_libraries_ligature_cells.measure.map!(const(font_libraries_ligature_cells.hb_glyph_info_t)[])(const(font_libraries_ligature_cells.hb_glyph_info_t)[] r) pure nothrow @nogc @safe

Implements the homonym function (also known as transform) present in many languages of functional flavor. The call ``map!(fun)(range) returns a range of which elements are obtained by applying fun(a) left to right for all elements a in range. The original ranges are not changed. Evaluation is done lazily.

Examples

import std.algorithm.comparison : equal;
import std.range : chain, only;
auto squares =
    chain(only(1, 2, 3, 4), only(5, 6)).map!(a => a * a);
assert(equal(squares, only(1, 4, 9, 16, 25, 36)));

Multiple functions can be passed to map. In that case, the element type of map is a tuple containing one element for each function.

auto sums = [2, 4, 6, 8];
auto products = [1, 4, 9, 16];

size_t i = 0;
foreach (result; [ 1, 2, 3, 4 ].map!("a + a", "a * a"))
{
    assert(result[0] == sums[i]);
    assert(result[1] == products[i]);
    ++i;
}

You may alias map with some function(s) to a symbol and use it separately:

import std.algorithm.comparison : equal;
import std.conv : to;

alias stringize = map!(to!string);
assert(equal(stringize([ 1, 2, 3, 4 ]), [ "1", "2", "3", "4" ]));
@paramfun one or more transformation functions@seeMap (higher-order function)@paramr an input range@returnsA range with each fun applied to all the elements. If there is more than one fun, the element type will be Tuple containing one element for each fun.
map
!(i => i.codepoint)))
continue; ++
(local variable) ulong changed
changed
;
int
(local variable) int reach
reach
;
foreach (
(parameter) ulong i
i
,
(parameter) const(font_libraries_ligature_cells.hb_glyph_info_t) info
info
;
(local variable) const(font_libraries_ligature_cells.Shaped) a
a
.
(field) font_libraries_ligature_cells.hb_glyph_info_t[] font_libraries_ligature_cells.Shaped.infos
infos
)
(local variable) int reach
reach
=
int std.algorithm.comparison.max!(int, int)(int a, int b) pure nothrow @nogc @safe

Iterates the passed arguments and returns the maximum value.

Examples

int a = 5;
short b = 6;
double c = 2;
auto d = max(a, b);
assert(is(typeof(d) == int));
assert(d == 6);
auto e = min(a, b, c);
assert(is(typeof(e) == double));
assert(e == 2);
@paramargs The values to select the maximum from. At least two arguments must be passed, and they must be comparable with <.@returnsThe maximum of the passed-in values. The type of the returned value is the type among the passed arguments that is able to store the largest value. If at least one of the arguments is NaN, the result is an unspecified value. See maxElement for examples on how to cope with NaNs.@seemaxElement
max
(
(local variable) int reach
reach
,
int font_libraries_ligature_cells.spill(font_libraries_ligature_cells.hb_font_t* font, font_libraries_ligature_cells.hb_glyph_info_t info, font_libraries_ligature_cells.hb_glyph_position_t pos, int cell) @trusted

How far, in font units, a glyph's ink reaches outside [0, cell).

spill
(
(local variable) font_libraries_ligature_cells.hb_font_t* font
font
,
(local variable) const(font_libraries_ligature_cells.hb_glyph_info_t) info
info
,
(local variable) const(font_libraries_ligature_cells.Shaped) a
a
.
(field) font_libraries_ligature_cells.hb_glyph_position_t[] font_libraries_ligature_cells.Shaped.positions
positions
[
(local variable) ulong i
i
],
(local variable) const(int) cell
cell
));
if (
(local variable) int reach
reach
> 0)
++
(local variable) ulong spilled
spilled
;
if (
(local variable) int reach
reach
>
(local variable) int worst
worst
)
{
(local variable) int worst
worst
=
(local variable) int reach
reach
;
(local variable) string worstSeq
worstSeq
=
(local variable) immutable(string) seq
seq
;
} }
void std.stdio.writefln!(char, string, const(uint), const(int))(in char[] fmt, string __param_1, const(uint) __param_2, const(int) __param_3) @safe

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

writefln
("%s: upem %d, cell %d",
(parameter) string path
path
.
string std.path.baseName!(immutable(char))(return scope string path) pure nothrow @nogc @safe

Note

This function only strips away the specified suffix, which doesn't necessarily have to represent an extension. To remove the extension from a path, regardless of what the extension is, use stripExtension. To obtain the filename without leading directories and without an extension, combine the functions like this:

assert(baseName(stripExtension("dir/file.ext")) == "file");
@paramcs Whether or not suffix matching is case-sensitive.@parampath A path name. It can be a string, or any random-access range of characters.@paramsuffix An optional suffix to be removed from the file name.@returns

The name of the file in the path name, without any leading directory and with an optional suffix chopped off.

If suffix is specified, it will be compared to path using filenameCmp!cs, where cs is an optional template parameter determining whether the comparison is case sensitive or not. See the filenameCmp documentation for details.

@standardsThis function complies with the POSIX requirements for the 'basename' shell utility (with suitable adaptations for Windows paths).
baseName
,
(local variable) const(uint) upem
upem
,
(local variable) const(int) cell
cell
);
void std.stdio.writefln!(char, ulong, ulong, ulong, ulong)(in char[] fmt, ulong __param_1, ulong __param_2, ulong __param_3, ulong __param_4) @safe

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

writefln
(" %d of %d sequences shape differently; %d change the glyph count; "
~ "%d have an off-cell advance",
(local variable) ulong changed
changed
,
(immutable global) immutable(string[]) font_libraries_ligature_cells.corpus

The union of four fonts' ligature inventories, plus Latin liga pairs.

corpus
.
(field) ulong immutable(string[]).length
length
,
(local variable) ulong countChanged
countChanged
,
(local variable) ulong offGrid
offGrid
);
void std.stdio.writefln!(char, ulong, double, string)(in char[] fmt, ulong __param_1, double __param_2, string __param_3) @safe

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

writefln
(" %d draw ink outside a glyph's own cell; worst reach %.2f cells (%s)",
(local variable) ulong spilled
spilled
, double(
(local variable) int worst
worst
) /
(local variable) const(int) cell
cell
,
(local variable) string worstSeq
worstSeq
);
}
(alias) object.string = string
string
[]
string[] font_libraries_ligature_cells.resolveFonts(string[] args) @safe
resolveFonts
(
(alias) object.string = string
string
[]
(parameter) string[] args
args
) @safe
{ auto
(local variable) string[] given
given
=
(parameter) string[] args
args
[1 .. $].
std.algorithm.iteration.FilterResult!(exists, string[]) std.algorithm.iteration.filter!(exists).filter!(string[])(string[] range) pure nothrow @nogc @safe

filter`!(predicate)(`range`)` returns a new `range` containing only elements `x` in range`` for which predicate(x) returns true.

The predicate is passed to unaryFun, and can be either a string, or any callable that can be executed via pred(element).

Examples

import std.algorithm.comparison : equal;
import std.math.operations : isClose;
import std.range;

int[] arr = [ 1, 2, 3, 4, 5 ];

// Filter below 3
auto small = filter!(a => a < 3)(arr);
assert(equal(small, [ 1, 2 ]));

// Filter again, but with Uniform Function Call Syntax (UFCS)
auto sum = arr.filter!(a => a < 3);
assert(equal(sum, [ 1, 2 ]));

// In combination with chain() to span multiple ranges
int[] a = [ 3, -2, 400 ];
int[] b = [ 100, -101, 102 ];
auto r = chain(a, b).filter!(a => a > 0);
assert(equal(r, [ 3, 400, 100, 102 ]));

// Mixing convertible types is fair game, too
double[] c = [ 2.5, 3.0 ];
auto r1 = chain(c, a, b).filter!(a => cast(int) a != a);
assert(isClose(r1, [ 2.5 ]));
@parampredicate Function to apply to each element of range@returnsAn input range that contains the filtered elements. If range is at least a forward range, the return value of filter will also be a forward range.@seeFilter (higher-order function), filterBidirectional@paramrange An input range of elements@returnsA range containing only elements x in range for which predicate(x) returns true.
filter
!
(template) 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
.
string[] std.array.array!(std.algorithm.iteration.FilterResult!(exists, string[]))(std.algorithm.iteration.FilterResult!(exists, string[]) r) nothrow @safe

Allocates an array and initializes it with copies of the elements of range r.

Narrow strings are handled as follows:

  • If autodecoding is turned on (default), then they are handled as a separate overload.

  • If autodecoding is turned off, then this is equivalent to duplicating the array.

@paramr range (or aggregate with opApply function) whose elements are copied into the allocated array@returnsallocated and initialized array
array
;
if (
(local variable) string[] given
given
.
(field) ulong string[].length
length
)
return
(local variable) string[] given
given
;
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; } int
int D main(string[] args)
main
(
(alias) object.string = string
string
[]
(parameter) string[] args
args
)
{ const
(local variable) const(string[]) fonts
fonts
=
string[] font_libraries_ligature_cells.resolveFonts(string[] args) @safe
resolveFonts
(
(parameter) string[] args
args
);
if (!
(local variable) const(string[]) fonts
fonts
.
(field) ulong const(string[]).length
length
)
{
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 paths, or install fontconfig)");
return 0; } foreach (
(parameter) const(string) path
path
;
(local variable) const(string[]) fonts
fonts
)
void font_libraries_ligature_cells.measure(string path) @trusted
measure
(
(local variable) const(string) path
path
);
return 0; }