<commit_before>(ns pixelfont.core
  (:require [infinitelives.pixi.canvas :as c]
            [infinitelives.pixi.events :as e]
            [infinitelives.pixi.resources :as r]
            [infinitelives.pixi.texture :as t]
            [infinitelives.pixi.sprite :as s]
            [infinitelives.pixi.pixelfont :as pf]
            [cljs.core.async :refer [<!]])
  (:require-macros [cljs.core.async.macros :refer [go]]
                   [infinitelives.pixi.macros :as m]
                   [infinitelives.pixi.pixelfont :as pf]))

(defonce canvas
  (c/init {:layers [:bg]
           :background 0x404040
           :expand true}))

(defonce main-thread
  (go
    (<! (r/load-resources canvas :bg ["img/fonts.png"]))

    (pf/pixel-font :big "img/fonts.png" [127 84] [250 128]
                   :chars ["ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                           "abcdefghijklmnopqrstuvwxyz"
                           "0123456789!?#`'.,"])


    (m/with-sprite canvas :bg
      [text (pf/make-text :big "TestWordage")]
      (while true (<! (e/next-frame)))
      )

    ;(t/set-texture! :font (r/get-texture :fonts :nearest))

    #_ (m/with-sprite canvas :bg
      [rabbit (s/make-sprite :font :xhandle 0.2 :yhandle 0.2 :scale 2)]
      (loop [angle 0]
        ;(s/set-rotation! rabbit angle)
        (<! (e/next-frame))
        (recur (+ 0.01 angle))))))<commit_msg>pixelfont example<commit_after>(ns pixelfont.core
  (:require [infinitelives.pixi.canvas :as c]
            [infinitelives.pixi.events :as e]
            [infinitelives.pixi.resources :as r]
            [infinitelives.pixi.texture :as t]
            [infinitelives.pixi.sprite :as s]
            [infinitelives.pixi.pixelfont :as pf]
            [cljs.core.async :refer [<!]])
  (:require-macros [cljs.core.async.macros :refer [go]]
                   [infinitelives.pixi.macros :as m]
                   [infinitelives.pixi.pixelfont :as pf]))

(defonce canvas
  (c/init {:layers [:bg]
           :background 0x404040
           :expand true}))

(defonce main-thread
  (go
    (<! (r/load-resources canvas :bg ["img/fonts.png"]))

    (pf/pixel-font :big "img/fonts.png" [127 84] [500 128]
                   :chars ["ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                           "abcdefghijklmnopqrstuvwxyz"
                           "0123456789!?#`'.,"])


    (m/with-sprite canvas :bg
      [text (pf/make-text :big "The quick brown fox jumped over the lazy sequence!"
                          {"fo" -2  "ro" -1 "la" -1 })]
      (while true (<! (e/next-frame)))
      )

    ;(t/set-texture! :font (r/get-texture :fonts :nearest))

    #_ (m/with-sprite canvas :bg
      [rabbit (s/make-sprite :font :xhandle 0.2 :yhandle 0.2 :scale 2)]
      (loop [angle 0]
        ;(s/set-rotation! rabbit angle)
        (<! (e/next-frame))
        (recur (+ 0.01 angle))))))
{'fraction_non_alphanumeric': 0.15351963211885392, 'fraction_numerical': 0.027237354085603113, 'mean_word_length': 1.9737118822292323, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2355228', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1010, 'n_words': 208}