qmk_firmware/assets/quantum_painter_qff.md.kLNwshez.js

16 lines
17 KiB
JavaScript
Raw Normal View History

import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.DyMmIvSC.js";
const __pageData = JSON.parse('{"title":"QMK Font Format","description":"","frontmatter":{},"headers":[],"relativePath":"quantum_painter_qff.md","filePath":"quantum_painter_qff.md"}');
const _sfc_main = { name: "quantum_painter_qff.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="qmk-font-format" tabindex="-1">QMK Font Format <a class="header-anchor" href="#qmk-font-format" aria-label="Permalink to &quot;QMK Font Format {#qmk-font-format}&quot;"></a></h1><p>QMK uses a font format <em>(&quot;Quantum Font Format&quot; - QFF)</em> specifically for resource-constrained systems.</p><p>This format is capable of encoding 1-, 2-, 4-, and 8-bit-per-pixel greyscale- and palette-based images into a font. It also includes RLE for pixel data for some basic compression.</p><p>All integer values are in little-endian format.</p><p>The QFF is defined in terms of <em>blocks</em> -- each <em>block</em> contains a <em>header</em> and an optional <em>blob</em> of data. The <em>header</em> contains the block&#39;s <em>typeid</em>, and the length of the <em>blob</em> that follows. Each block type is denoted by a different <em>typeid</em> has its own block definition below. All blocks are defined as packed structs, containing zero padding between fields.</p><p>The general structure of the file is:</p><ul><li><em>Font descriptor block</em></li><li><em>ASCII glyph block</em> (optional, only if ASCII glyphs are included)</li><li><em>Unicode glyph block</em> (optional, only if Unicode glyphs are included)</li><li><em>Font palette block</em> (optional, depending on frame format)</li><li><em>Font data block</em></li></ul><h2 id="qff-block-header" tabindex="-1">Block Header <a class="header-anchor" href="#qff-block-header" aria-label="Permalink to &quot;Block Header {#qff-block-header}&quot;"></a></h2><p>The block header is identical to <a href="./quantum_painter_qgf#qgf-block-header">QGF&#39;s block header</a>, and is present for all blocks, including the font descriptor.</p><h2 id="qff-font-descriptor" tabindex="-1">Font descriptor block <a class="header-anchor" href="#qff-font-descriptor" aria-label="Permalink to &quot;Font descriptor block {#qff-font-descriptor}&quot;"></a></h2><ul><li><em>typeid</em> = 0x00</li><li><em>length</em> = 20</li></ul><p>This block must be located at the start of the file contents, and can exist a maximum of once in an entire QGF file. It is always followed by either the <em>ASCII glyph table</em> or the <em>Unicode glyph table</em>, depending on which glyphs are included in the font.</p><p><em>Block</em> format:</p><div class="language-c vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">typedef</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> struct</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> __attribute__</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">((packed)) </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">qff_font_descriptor_v1_t</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>\n<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> qgf_block_header_v1_t</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> header;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // = { .type_id = 0x00, .neg_type_id = (~0x00), .length = 20 }</span></span>\n<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> uint24_t</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> magic;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // constant, equal to 0x464651 (&quot;QFF&quot;)</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> uint8_t</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> qff_version;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // constant, equal to 0x01</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> uint32_t</span><span style="--shiki-light
const _hoisted_31 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, _hoisted_31);
}
const quantum_painter_qff = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
quantum_painter_qff as default
};