Skip to content

Instantly share code, notes, and snippets.

View vitalfadeev's full-sized avatar

Vital Fadeev vitalfadeev

  • Russia
View GitHub Profile
@vitalfadeev
vitalfadeev / Makefile
Last active November 15, 2022 10:07
Create disk image with GRUB2 installd
# Create disk image with GRUB2 installd
# Requires: grub-install rm mkdir dd parted kpartx mkfs.vfat mkfs.ext2 cp mount umount chown
# Source tree:
# img/
# ext2 fat16 fat32
FS=ext2
#
DISK_FILE=disk.img
DISK_SIZE=20
BUILD_FOLDER=.build
@smhanov
smhanov / OpenType.ts
Last active March 30, 2025 18:19
Here is my implementation of a TrueType font reader in Typescript. You can read a font directly from an ArrayBuffer, and then call drawText() to draw it. See my article http://stevehanov.ca/blog/index.php?id=143. The second file, OpenType.ts is the same thing but it handles more TrueType files. It is also more coplex
// To see this run, you first stub out these imports. Then put the file in a Uint8Array.
// let slice = new Slice(array);
// let font = new OTFFont(slice);
// Then you can call methods like font.drawText(canvasContext, )
//
//
import { ICanvasContext } from "./ICanvasContext"
import { log as Log } from "./log"
const log = Log.create("OPENTYPE");