ソースを参照

[Ttf]:
- added range str support
- parse (but not use) cmap12
- multiple fixes

Simon Krajewski 12 年 前
コミット
845f862dfa
1 ファイル変更6 行追加2 行削除
  1. 6 2
      genswf.ml

+ 6 - 2
genswf.ml

@@ -812,11 +812,15 @@ let build_swf9 com file swc =
 		| TClassDecl c ->
 		| TClassDecl c ->
 			let rec loop = function
 			let rec loop = function
 				| [] -> acc
 				| [] -> acc
-				| (":font",[EConst (String file),p],_) :: l ->
+				| (":font",(EConst (String file),p) :: args,_) :: l ->
 					let ch = try open_in_bin file with _ -> error "File not found" p in
 					let ch = try open_in_bin file with _ -> error "File not found" p in
 					let ttf = Ttf.parse ch in
 					let ttf = Ttf.parse ch in
 					close_in ch;
 					close_in ch;
-					let ttf_swf = Ttf.write_swf ttf "" in
+					let range_str = match args with
+						| [EConst (String str),_] -> str
+						| _ -> ""
+					in
+					let ttf_swf = Ttf.write_swf ttf range_str in
 					let ch = IO.output_string () in
 					let ch = IO.output_string () in
 					let b = IO.output_bits ch in
 					let b = IO.output_bits ch in
 					Ttf.write_font2 ch b ttf_swf;
 					Ttf.write_font2 ch b ttf_swf;