diff --git a/src/clj_figlet/core.clj b/src/clj_figlet/core.clj index 753923b..7b504b5 100644 --- a/src/clj_figlet/core.clj +++ b/src/clj_figlet/core.clj @@ -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)] + )))