keep a copy of the hardblank char as a string as well
avoids us needed to constantly do (str hardblank)
This commit is contained in:
parent
3217e92c00
commit
0140c2722b
|
@ -9,12 +9,14 @@
|
||||||
(def num-ext-chars 7)
|
(def num-ext-chars 7)
|
||||||
|
|
||||||
(defn- parse-flf-header [header-line]
|
(defn- parse-flf-header [header-line]
|
||||||
(let [parts (str/split header-line #" ")
|
(let [parts (str/split header-line #" ")
|
||||||
params (->> parts
|
hardblank (-> parts first last)
|
||||||
(rest)
|
params (->> parts
|
||||||
(map #(Integer/parseInt %))
|
(rest)
|
||||||
(vec))]
|
(map #(Integer/parseInt %))
|
||||||
{:hardblank (-> parts first last)
|
(vec))]
|
||||||
|
{:hardblank hardblank
|
||||||
|
:hardblank-str (str hardblank) ; we'll be using this a fair bit, sometimes as a string, not a char
|
||||||
:height (get params 0)
|
:height (get params 0)
|
||||||
:baseline (get params 1)
|
:baseline (get params 1)
|
||||||
:max-length (get params 2)
|
:max-length (get params 2)
|
||||||
|
@ -89,7 +91,7 @@
|
||||||
|
|
||||||
(defn- render-char [c flf lines]
|
(defn- render-char [c flf lines]
|
||||||
(let [char-lines (get-in flf [:chars c])
|
(let [char-lines (get-in flf [:chars c])
|
||||||
hardblank (str (get-in flf [:header :hardblank]))]
|
hardblank (get-in flf [:header :hardblank-str])]
|
||||||
(if char-lines
|
(if char-lines
|
||||||
(map
|
(map
|
||||||
(fn [^String char-line ^String output-line]
|
(fn [^String char-line ^String output-line]
|
||||||
|
|
Loading…
Reference in a new issue