font-install
font-install copied to clipboard
[windows] add AddFontResource
Add AddFontResource on windows so that after installation, you can find the font in other applications.
gdi32dll := syscall.NewLazyDLL("Gdi32.dll")
procAddFontResource := gdi32dll.NewProc("AddFontResourceW")
filePath, _:= syscall.UTF16PtrFromString("C://.../xxx.ttf")
_, _, _ = procAddFontResource.Call(uintptr(unsafe.Pointer(filePath)))
https://github.com/CarsonSlovoka/font-install/blob/9c62bb40123847f4c38854c6c37d65736c4ed92e/install_windows.go#L94-L104