add file header validation
This commit is contained in:
parent
4455bb6d65
commit
197b5d20ee
|
@ -9,8 +9,10 @@
|
|||
:num-comments (Integer/parseInt (nth parts 5))}))
|
||||
|
||||
(defn load-flf [file]
|
||||
(let [lines (str/split (slurp file) #"\n")
|
||||
header (parse-flf-header (first lines))
|
||||
char-lines (drop (inc (:num-comments header)) lines)]
|
||||
))
|
||||
|
||||
(let [flf-file (slurp file)]
|
||||
(if-not (= "flf2a" (subs flf-file 0 5))
|
||||
(throw (new Exception (str "Not a valid flf font file: " file))))
|
||||
(let [lines (str/split (slurp file) #"\n")
|
||||
header (parse-flf-header (first lines))
|
||||
char-lines (drop (inc (:num-comments header)) lines)]
|
||||
)))
|
||||
|
|
Loading…
Reference in a new issue