window

what it needs

the dependencies, what is vendored and what is pinned

mirrored from window/cpp/DEPS.md, which is the only copy of this text. edits made here are overwritten the next time the site builds

P1.2. one dependency, blend2d, which drags in asmjit for its jit. both get vendored as source we build ourselves, no vcpkg, no cmake, no submodule, no prebuilt dll. the build must not reach the network n a clean rebuild has to land on the same bytes, which is the whole reason the version sits in a doc

the pin

whatversioncommitdatedupstream
blend2d0.21.26dbc2cefbc996379e07104e34519a440b49b15d72025-11-29<https://github.com/blend2d/blend2d>
asmjitno version, ever12f9ca3b320e0d7e7eb6637a6af7fedbd12b8ddc2025-11-29<https://github.com/asmjit/asmjit>

neither project tags anything, there is not a single git tag or github release on either repo, so a commit sha is the only honest pin. blend2d names its releases on <https://blend2d.com/download.html> instead, n carries the number in a macro

// blend2d/core/api.h
#define BL_VERSION BL_MAKE_VERSION(0, 21, 2)

why this exact pair

  • the 0.21.2 release is commit def0d12 (2025-11-02). the two commits after it, up to the master head we pin, touch README.md, CONTRIBUTING.md, .github/FUNDING.yml n two comment blocks, no code at all, so our pin is 0.21.2 with tidier docs on top
  • asmjit is not pinned by blend2d in any way, no submodule, no hash, no FetchContent, n blend2ds ci checks out asmjits default branch with no ref. so the pair that upstream ci last actually built together is whatever asmjit master was on the day blend2d master last moved, n 12f9ca3b is that commit
  • asmjit master has since run about four months further on with its own api churn while blend2d has not moved since 2025-11-29, so taking both at head is a real risk n taking asmjit at head is the bigger half of it. this is the reason the asmjit sha is in this table rather than a shrug

what we came off

the ahk lib next door runs the vcpkg port blend2d 2025-03-08#1, upstream commit d2027ebfd6aaf53b190b6b3b497425fc85f14251, which is BL_VERSION 0.12.0, built x64-windows dynamic with asmjit 2025-10-13, sitting as two dlls in ../gui/bin/. that stays exactly where it is, it is what the working ahk lib loads

so we are stepping 0.12.0 to 0.21.2, nine minor versions, n two of the differences will be felt

  • the whole c api was renamed to snake_case. blFontVariationSettingsSetValue is now bl_font_variation_settings_set_value, n so on across the board. this does not touch us much bc c++ calls the c++ api (BLContext, BLPath, BLFont) n that is what we are porting to, but it does mean ../gui/b2d.ahk is a name-for-name guide n not a copyable one, every DllCall string in it is a 0.12 name
  • the source layout moved, there is no src/ directory any more. sources n headers live under blend2d/ at the repo root, split into core/, opentype/, raster/, pipeline/ n friends, n the public header is blend2d/blend2d.h included as #include <blend2d/blend2d.h>. every build instruction you find on the web that says src/ is describing 0.12 or older

G-window-1, the answer

G-window-1, blend2d builds clean x64 msvc n we can state which version implements opentype variations

no version implements them, n upstream says it may never happen. the flag has been declared with nothing behind it since it was added, in every version including the one we just pinned

  • BL_FONT_FACE_FLAG_OPENTYPE_VARIATIONS = 0x20000000u is declared in blend2d/core/fontface.h, n nothing in blend2d/opentype/otface.cpp ever sets it
  • blend2d/opentype/ has no fvar, gvar, avar, HVAR or STAT parser, the folder is cmap, cff, glyf, kern, layout, metrics, name n core, exactly as it was in 0.12. the kFVAR n kGVAR entries in fonttagdataids_p.h are a tag name table, not a reader, n OTFaceFlags::kGSubFVar is the GSUB FeatureVariations subtable which is a different feature entirely
  • BLFontVariationSettings is real, set_value() takes your wght n stores it, BLFont accepts the settings, n rendering ignores all of it. it does not error, which is why this looked like a dll packaging problem for so long
  • the author, on 2025-12-01 in issue 248, which is still open, says variations are not implemented, that it is only exposed n not implemented, n that given the funding he is not sure it will ever get done. issue 239 from 2025-09-11 says the same thing n was closed with no fix

what that changes in the plan. the design section says the blend2d version is ours to pick, so the opentype variation axis stops being blocked on a pinned dll, n that reading is wrong. it was never the pinning, the feature does not exist upstream at any version, so picking our own build buys us plenty (the 0.12 to 0.21 fixes, our own compile flags, a static lib, symbols in a debugger) but it does not buy the variation axis

so P1.8s synthetic weight stand in is not a stopgap, it is the plan, n face_is_variable gating on the face flag is still the right shape bc it costs nothing n switches itself on if the day ever comes. if a real variable axis turns out to be load bearing, the options are dwrite for text (which kills the one pointer-plus-stride seam the whole design hangs on, so, no), a freetype backed BLFontData, or paying upstream. none of those belong in P1

the builds clean x64 msvc half of the gate is still open, it gets proven the first time the solution in BUILD.md compiles

fetching it

this needs the network so its finns to run, not an agents. nushell, from the repo

cd D:\projects\projects\window\cpp\extern

# blend2d, one commit, no history
mkdir blend2d
cd blend2d
git init
git remote add origin https://github.com/blend2d/blend2d.git
git fetch --depth 1 origin 6dbc2cefbc996379e07104e34519a440b49b15d7
git checkout FETCH_HEAD
rm -r .git

# asmjit, same again
cd ..
mkdir asmjit
cd asmjit
git init
git remote add origin https://github.com/asmjit/asmjit.git
git fetch --depth 1 origin 12f9ca3b320e0d7e7eb6637a6af7fedbd12b8ddc
git checkout FETCH_HEAD
rm -r .git

--depth 1 on an exact sha pulls one tree n no history, which is a few tens of mb rather than the lot. the .git goes bc these are our files now, a nested repo inside ours only ever causes grief

do not modify anything under extern/. not a formatting pass, not a warning fix, not deleting the cmake files we do not use. the moment we edit a vendored copy, every future upgrade turns into a merge, n the whole point of pinning by sha is that the copy on disk is provably the upstream one

checking what you have

# should print BL_VERSION BL_MAKE_VERSION(0, 21, 2)
open --raw extern/blend2d/blend2d/core/api.h | lines | where {|l| $l =~ 'define BL_VERSION' }

# should be 0, no leftover git dirs
ls extern/**/.git | length

upgrading later, the rule

blend2d is 0.x n says out loud that its api is free to move, n 0.12 to 0.21 renaming every symbol is that promise being kept. so an upgrade is a task with its own item, never a drive-by

  • move both shas together, blend2d first, then asmjit to whatever its master was on blend2ds commit date
  • update the table at the top of this file in the same change, a pin thats only in someones shell history is not a pin
  • re-run the headless dumps from P1.31 n compare them, thats what that harness is for
  • the six gotchas in ../gui/PLAN-blend2d-renderer.md were all measured against 0.12, so re-check the two dll bugs on 0.21 before routing around them, comp op 11 landing as src_copy n set_alpha sharing a save stack with push_clip may well be fixed, n carrying a workaround for a fixed bug is worse than the bug

the two dll bugs, re-measured on 0.21.2 (P1.6)

both were measured on 0.12 by the ahk lib, both were re-run against the pinned build n the runner now pins each answer, so the next version bump trips a check rather than being taken on trust

the 0.12 bugon 0.21.2what we do
comp op CLEAR through a colour fill lands as a src_copy of the colourstill live, a clear of green over red leaves 0xFF00FF00keep the workaround, clear_rect goes through a different entry point n really does zero
set_alpha shares one save stack with push_clip, they must not interleaveconfirmed, n it was never a bug, that is just how blend2d works, a restore does put the global alpha backthe interface answers it, one pop() n no per kind reset, so the interleave cannot be written

the roads not taken

  • vcpkg, which is where the ahk lib got its dlls. it reaches the network at build time, it hands us a version someone else picked, n it gave us a dynamic build we could not put a breakpoint in. all three are the reason P1.2 exists
  • cmake, even once, to produce a .lib we then commit. finns toolchain is msvc through vs2022 n the plan says no cmake anywhere, n a binary in the tree built by a tool nobody has installed is exactly the thing we are getting away from
  • a git submodule. it keeps the sha honest for free, which is genuinely nice, but a clone now needs the network to be complete n D:\projects\projects is not a git repo at all today, so it would be solving a problem we do not have with a tool we are not using
  • BL_BUILD_NO_JIT, which drops asmjit entirely n takes the version pairing risk with it. it also drops the jit pipelines to the portable ones n makes P1.7 meaningless, n the jit is a good chunk of why b2d beat d2d by 14x on the dirty rect path. keep it in the back pocket as the escape hatch if the blend2d n asmjit pair fights us, nothing else

On this page