mcpp index

compat.msdfgen

#include

msdfgen — multi-channel signed distance field generator (core + FreeType import)

#include <msdfgen/msdfgen.h>
mcpp add compat.msdfgen@1.13

用法

來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。

// compat.msdfgen — generate a real multi-channel signed distance field and
// assert its contents, not just that the library links.
//
// The shape is a square built by hand, so the test needs no font file and no
// ext/ importer. What makes the assertions real:
//   * the field must be signed -- inside the square the distance is positive,
//     outside it is negative. A blank or all-zero bitmap fails both.
//   * edge colouring must have run, otherwise the three channels are identical
//     and the "multi-channel" part of MSDF did nothing.
//
// The `msdfgen/` include prefix is the one this package generates; using it
// here is what keeps the shim covered by CI.
#include <msdfgen/msdfgen.h>
#include <msdfgen/msdfgen-ext.h>
import std;

int main() {
    bool ok = true;

    auto check = [&](bool cond, std::string_view what) {
        if (!cond) {
            std::println("FAIL: {}", what);
// …

tests/examples/msdfgen/tests/generate.cpp · 專案 tests/examples/msdfgen

建置

targets
msdfgen (lib)
language
c++23
import std
no
include dirs
*, mcpp_generated

原始檔 (2)

  • */core/*.cpp
  • */ext/import-font.cpp

產生的檔案

  • mcpp_generated/msdfgen/msdfgen-ext.h
  • mcpp_generated/msdfgen/msdfgen-config.h
  • mcpp_generated/msdfgen/msdfgen.h

版本

版本平台 鏡像sha256
1.13 最新 LinuxWindowsmacOS GLOBAL CN 93cd1ad8918c…