Skip to content

Instantly share code, notes, and snippets.

@doraTeX
doraTeX / generateQRcode.swift
Last active December 21, 2023 10:32
QR Code Generator written in Swift 4
import Quartz
extension CGImage {
class func qrCodeImage(from string: String, scale: CGFloat = 1) -> CGImage? {
let stringData = string.data(using: .utf8)
let transform = CGAffineTransform(scaleX: scale, y: scale)
guard let filter = CIFilter(name: "CIQRCodeGenerator") else {
return nil
}
32 /System/Library/Fonts/Apple Braille Outline 6 Dot.ttf
36 /System/Library/Fonts/Apple Braille Outline 8 Dot.ttf
24 /System/Library/Fonts/Apple Braille Pinpoint 6 Dot.ttf
24 /System/Library/Fonts/Apple Braille Pinpoint 8 Dot.ttf
16 /System/Library/Fonts/Apple Braille.ttf
88304 /System/Library/Fonts/Apple Color Emoji.ttc
532 /System/Library/Fonts/Apple Symbols.ttf
17096 /System/Library/Fonts/AppleSDGothicNeo.ttc
12980 /System/Library/Fonts/AquaKana.ttc
64 /System/Library/Fonts/ArialHB.ttc
File: /Library/Fonts/AppleGothic.ttf
id 0
Name: AppleGothic
Format: TrueType
Lang: de|fj|ho|ia|ig|ie|io|ko|nds|nr|om|so|ss|st|sw|ts|uz|vo|xh|yap|zu|kj|kwm|lg|ms|ng|rn|rw|sn|za
File: /Library/Fonts/AppleMyungjo.ttf
id 0
Name: AppleMyungjo
196 /System/Library/Fonts/SFCompactDisplay-Heavy.otf
200 /System/Library/Fonts/SFCompactText-Medium.otf
212 /System/Library/Fonts/SFCompactRounded-Bold.otf
152 /System/Library/Fonts/SFNSTextCondensed-Bold.otf
17420 /System/Library/Fonts/AppleSDGothicNeo.ttc
472 /System/Library/Fonts/SFNSDisplay.ttf
972 /System/Library/Fonts/Menlo.ttc
32772 /System/Library/Fonts/STHeiti Medium.ttc
212 /System/Library/Fonts/SFCompactRounded-Medium.otf
136 /System/Library/Fonts/SFNSTextCondensed-Medium.otf
@doraTeX
doraTeX / chemfig_hiragino.tex
Created May 3, 2017 13:50
chemfig の原子出力にヒラギノ従属欧文を使う例 (LuaLaTeX)
%! lualatex
\documentclass{ltjsarticle}
\usepackage{chemfig}
\usepackage[hiragino-pron]{luatexja-preset}
\usepackage{unicode-math}
\setmathfontface\chemrm{HiraginoSans-W3.ttc} %% ヒラギノ角ゴシック W3 で数式の文字を出す命令 \chemrm を定義
\def\printatom#1{\ensuremath{\chemrm{#1}}} %% chemfig の原子出力命令を \chemrm に変更
\begin{document}
@doraTeX
doraTeX / Sierra-CK-ttcinfo.txt
Created December 13, 2016 08:45
Sierraの中韓TTCフォントの詳細情報
$ texlua ttcinfo.lua /Library/Fonts/Songti.ttc
ttcinfo: tag: ttcf
ttcinfo: version: 131072
ttcinfo: #fonts: 8
ttcinfo: offset: {56,276,528,780,1032,1284,1536,1788}
ttcinfo: Font #1: Songti_1.ttf
ttcinfo: Font #2: Songti_2.ttf
ttcinfo: Font #3: Songti_3.ttf
ttcinfo: Font #4: Songti_4.ttf
@doraTeX
doraTeX / ModifiedNFD-test.m
Created October 12, 2016 16:06
Test of Modified-NFD (HFS+ style Unicode normalization)
// clang -lobjc -framework Foundation -o ModifiedNFD-test ModifiedNFD-test.m
#import <Foundation/Foundation.h>
#import <stdio.h>
void dump(NSString* str) {
for (NSUInteger i = 0; i < str.length; i++) {
puts([NSString stringWithFormat:@"U+%04X", [str characterAtIndex:i]].UTF8String);
}
}
@doraTeX
doraTeX / ttcinfo.lua
Created October 4, 2016 17:21
Show information of a TTC file (derived from zrdecompttc.lua https://gist.github.com/zr-tex8r/7058922 )
-- ttcinfo.lua
prog_name = "ttcinfo"
version = "0.1"
mod_date = "2016/10/05"
verbose = true
----------------------------------------
ttc_file, ttf_base, ttf_ext, ttf_idb = nil
----------------------------------------
do
local reader_meta = {
@doraTeX
doraTeX / Sierra-CK-Fontlist.md
Last active June 6, 2019 03:10
macOS Sierra (10.12) に搭載されている中韓フォントのリスト

/Library/Fonts/Songti.ttc (0)

  • Family: Songti SC
  • Subfamily: Black
  • Full name: Songti SC Black
  • PostScript name: STSongti-SC-Black
  • Preferred family: Songti SC
  • Preferred subfamily: Black
  • Version: 11.0d2e2
  • Unique ID: Songti SC Black; 11.0d2e2; 2016-07-17
  • Trademark: STSongti and SinoType are trademarks of Changzhou SinoType Technology Co., Ltd.
@doraTeX
doraTeX / JisYuKyokasho-H
Last active October 3, 2016 05:16
CMap files for Kyokasho.ttc of macOS Sierra (10.12)
%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (JisYuKyokasho-H)
%%Title: (JisYuKyokasho-H Adobe Identity 0)
%%Version: 11.0
%%EndComments
% NOTICE:
% It is intended that this file is used only with dvipdfmx.