The .htx format the Horatio app reads today (HTX2, format version 2.0), for pack authors
A Horatio content pack is one binary file with the .htx extension. It starts with the four bytes HTX2 and holds every text of the pack, its manifest and the keys the app uses to find each text. Format version 2.0 replaced the old ZIP layout (manifest.json, codes_map.json, texts/, RPL/): the app no longer reads ZIP packs.
Texts are written in BMD markup. The app reads and checks the whole pack when it installs it, and works offline from then on. A pack holds texts in one language.
Who this page is for
Authors who build a pack for their own use or want to propose one. The app reads only what this page describes: anything else in a pack is ignored, and a pack that breaks a rule here is refused.
A pack is a fixed 50-byte header followed by the payload. All integers are little-endian.
offset size field
0 4 MAGIC "HTX2"
4 2 VERSION uint16 LE, 0x0200
6 2 FLAGS uint16 LE
8 2 LANG ASCII, e.g. "la", "en"
10 8 TIMESTAMP int64 LE, Unix seconds
18 16 MANIFEST_DIGEST BLAKE3, first 16 bytes
34 4 PAYLOAD_SIZE uint32 LE
38 12 RESERVED zero
50 - PAYLOAD records
| Field | Meaning |
|---|---|
MAGIC | Always HTX2; any other file is refused. |
VERSION | 0x0200. The app accepts 0x0200 to 0x02FF. |
FLAGS | Bit 0: compression (0 = deflate, 1 = zstd). Bit 1: DAY records present. Bit 2: META present, always set. Bit 3: a zstd dictionary is named in META. All other bits 0. |
LANG | Two-letter language code, padded with zero bytes. |
MANIFEST_DIGEST | The first 16 bytes of the BLAKE3 hash of the uncompressed payload. The app checks it on every install. |
PAYLOAD_SIZE | Length of the uncompressed payload in bytes. |
Compress the whole payload with raw deflate (no zlib header, level 9). A zstd pack needs a compression dictionary shipped with the app, so packs built outside PineSoft use deflate.
The app refuses a file larger than 128 MiB.
The payload is a stream of records. Each record starts with a one-byte tag. Strings are UTF-8 with a 32-bit length in front and no terminator.
META 0x00 [u8 tag] [u32 len] [JSON, UTF-8]
BLOB 0x01 [u8 tag] [u32 len] [text, UTF-8]
FRAG 0x02 [u8 tag] [u32 key_len] [key, UTF-8] [u32 blob_index]
DAY 0x03 reserved
| Record | Meaning |
|---|---|
META | JSON object with the build data and the pack manifest. Exactly one, the first record of the payload. |
BLOB | One distinct text. BLOBs are numbered in the order they are written: the first one is 0. |
FRAG | A fragment key and the number of the BLOB that holds its text. Several keys can point to the same BLOB, so an identical text is stored once. |
DAY | Reserved for precomputed days. Current packs do not write it; leave flag bit 1 at 0. |
Order: META, then all BLOBs, then all FRAGs sorted by key. Besides the manifest, META carries the build data below. fragment_count is the number of FRAG records, unique_text_count and text_count the number of BLOB records: the app checks them against the records.
{
"schema": "horatio.pack.v2",
"builder": "my-builder 1.0",
"source_commit": "unknown",
"corpus_blake3": "0f1e2d3c4b5a69788796a5b4c3d2e1f0",
"fragment_count": 150,
"unique_text_count": 150,
"text_count": 150,
"languages": ["la"],
"zstd_dict": null,
"manifest": { ... }
}
The manifest is the manifest object inside META. There is no separate manifest.json file.
"manifest": {
"id": "my-psalter-la",
"version": "1.0.0",
"name": "My Psalter",
"description": "Psalter for personal use",
"language": "lat",
"script": "latin",
"text_direction": "ltr",
"required_fonts": [],
"requires_app_version": "0.3.0",
"algorithms": [
{ "name": "psalm_doxology", "version": 1, "params": { "rule": "by_slot" } }
]
}
| Field | Meaning |
|---|---|
id | Required. A letter or digit, then letters, digits, ., _ or -, at most 64 characters. A file with the id of an installed pack updates that pack. |
name | Required. The name the pack manager shows. A pack without id or name is refused. |
version | Pack version in SemVer form (1.0.0). Raise it with every published change. |
description | Short description shown with the pack. |
language | Language of the text: 2 or 3 letters (ISO 639), optional subtags such as zh-Hans. Any other form is refused. |
script | Writing system: latin (default), greek, cyrillic, georgian, arabic, hebrew and others. |
text_direction | ltr (default) or rtl. |
required_fonts | Fonts the text needs. |
requires_app_version | The lowest Horatio version that renders this pack's text. Every install path refuses the pack on an older app. Leave it out when any version will do. |
algorithms | Algorithms the pack requires or offers: see Declared algorithms. |
min_app_version | Kept for compatibility and not checked: use requires_app_version. |
These fields are optional descriptive metadata. The app keeps them; they do not change how the text is read or shown:
author, period, genre, difficulty, fragment_count, has_translations, has_morphology, has_audio, pack_size_bytes, checksum_blake3, preservation_status, community_contact, source_institution, source, missal_editions, external_ids, dublin_core
The app finds each text by its key: parts written as Latin codes and separated by /. A ; in a key is read as /. A pack that serves the calendar must use the keys the app asks for.
| Key | Meaning |
|---|---|
BIB/GEN/001 | A Bible chapter: book code, then the chapter with three digits. |
PAS/ST02/2FER/L-ANT1 | A text of the Liturgy of the Hours: season, week, day, then hour and part (here Easter, week 2, Monday, Lauds, first antiphon). |
0117 | A celebration on a fixed date, as month and day (MMDD). |
Weekdays use Latin codes with the number first: 1DOM 2FER 3FER 4FER 5FER 6FER 7SAB
A BLOB holds the text of a fragment in BMD markup, optionally preceded by a front matter block between two --- lines. The app reads the BMD when it shows the text.
---
title: Psalm 1
work: Psalter
source_quality: humanTranslation
provenance: ed1
---
# Psalm 1
{Ant.} Antiphon text.
First half of the verse *
second half of the verse.
{Gloria}
| Key | Meaning |
|---|---|
title | Title to show. A title equal to the fragment's own key is not shown. |
work | Work or collection the text belongs to. |
language, script | Language and script of this fragment, when they differ from the pack. |
source_quality | How this text was produced: see Text quality and sources. |
provenance | Key of the source this text comes from: see Text quality and sources. |
| Markup | Meaning |
|---|---|
# ## ### | Headings, levels 1 to 3. |
{text} | Rubric, shown in red. |
{V.} {R.} {Ant.} | Versicle, response and antiphon labels. |
text * text + {*} {+} | Pause marks of a psalm verse: * at the end of a line, + shown as a dagger; {*} and {+} inside a line. |
//text// $text$ ^text^ | Italic, bold, superscript reference. |
{Ant|} {|Ant} | Antiphon block. |
{Rsp|} {|Rsp} {R*} | Responsory block; {R*} marks the part that is repeated. |
{Gloria} {!Gloria} | Insert the doxology here, or leave it out after this text. |
{Int|} {|Int} {C.} {A.} {P.} | Intercessions with leader, assembly and petition parts. |
{Ref ...} | Biblical reference. |
{Hour| name} {|Hour} {Sect| name} | A whole hour and its sections. |
@MEMORIA@ | Replaced, when the text is shown, by the name of the day's celebration. |
In algorithms a pack declares behaviour that the app implements and the pack switches on or fills with its own words. Each entry has a name, an integer version (1 when absent) and free-form params. The app applies the names and versions it implements and ignores the others, so an older app still opens the pack. Parameters are written in the language of the pack's text.
| Name | Version | Meaning |
|---|---|---|
page_labels | 1 | params.roles and params.titles: the words of a page that are not pack text (part names, titles), so the page speaks the language of its text. |
antiphon_labels | 1 | params: the antiphon labels in the pack's language. |
celebration_titles | 1 | params.titles and params.quality: names of celebrations the app lacks in the pack's language. |
source_provenance | 1 | params.sources: for each provenance key, a short badge label and the full name of the source. |
psalm_doxology | 1 | params.rule = by_slot: the app adds the doxology after each psalm and canticle unless the text carries {!Gloria}. |
hours_frame | 1 | Every hour opens with the initial invocation and ends with its conclusion; Lauds and Vespers carry the Lord's Prayer. |
laudes_with_readings | 1 | Lauds together with the Invitatory and the readings of the Office of Readings. |
laudes_gospel | 1 | The combined Lauds may carry the Gospel from the lectionary pack; only next to laudes_with_readings. |
gospel_population | 1 | params.keys: the Gospel keys a random Gospel is drawn from. |
compline_marian_antiphon | 1 | params.options and params.seasons: the Marian antiphon of each season at Compline, with the others to choose from. |
compline_examination | 1 | params.formulas and params.absolution: the extended examination of conscience at Compline. |
A fragment declares in its front matter how its text was produced, with source_quality. The app shows a badge next to machine-translated text.
| Value | Meaning |
|---|---|
original | Text from the original source. |
humanTranslation | Translated by a person. |
machineTranslation | Machine translation. |
verifiedTranslation | Machine translation checked by a person. |
missing | No text: the app shows a notice that the text is missing. |
A fragment without a value, or with an unknown one, takes the pack's value; for a pack the app does not know, that is original.
provenance names the source of a fragment. The pack declares a label and a name for each key with source_provenance, and the app shows a source badge beside the heading. An undeclared key shows nothing: the app never names a source by itself.
A pack reaches the app in three ways: chosen with the import button of the pack manager, shared to Horatio from another app (files, messaging, cloud storage), or copied into the app's sideload folder, which the app scans at start:
Android/data/com.pinesoft.horatio/files/sideload/
id is installed.id of an installed pack and different content (BLAKE3 of the file) replaces it: this is how you update a pack you installed yourself.requires_app_version is above the app's version is refused with a message. In the sideload folder it stays, and installs at the first start of an updated app.id or name, an invalid id or language, or a file over 128 MiB is refused, and nothing is written.installed/ subfolder.HTX2 and version 0x0200; the header is 50 bytes and its reserved bytes are zero.MANIFEST_DIGEST is the first 16 bytes of BLAKE3 over the uncompressed payload, and PAYLOAD_SIZE is its length.fragment_count and unique_text_count match the FRAG and BLOB records, and every FRAG points to an existing BLOB.id and name, and language is a valid code.version is SemVer and grows with every published change.requires_app_version is set when the text uses markup that only newer versions of the app render.Proposing a pack
We welcome texts in rare and endangered languages. To discuss including a pack in Horatio's catalog, write to support@pinesoft.dev