Skip to content

Commit

Permalink
fix(common): correct offsets in KMX+ spec
Browse files Browse the repository at this point in the history
Cherry-picked-from: #12305
  • Loading branch information
mcdurdin committed Sep 2, 2024
1 parent ccee8ed commit 0731c7b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/file-formats/kmx-plus-file-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ Then for each string:

|| Bits | Name | Description |
|---|------|---------------|-----------------------------------------------|
|16+| 32 | offset | off: Offset to string |
|20+| 32 | length | int: Length of string in UTF-16LE code units |
|12+| 32 | offset | off: Offset to string |
|16+| 32 | length | int: Length of string in UTF-16LE code units |

After the string offset table comes the actual UTF-16LE data. There is a null
(\u0000) after each string, which is _not_ included in the string length.
Expand Down Expand Up @@ -362,9 +362,9 @@ For each element:

|| Bits | Name | Description |
|---|------|---------|------------------------------------------|
|32+| 32 | to | str: to string |
|36+| 32 | id | str: id string |
|40+| 32 | display | str: output display string |
|16+| 32 | to | str: to string |
|20+| 32 | id | str: id string |
|24+| 32 | display | str: output display string |

Either `to` or `id` must be set, not both.
Entries with an `to` field are sorted in a binary codepoint sort on the `to` field,
Expand Down Expand Up @@ -423,8 +423,8 @@ For each flicks in the flick list:
|| Bits | Name | Description |
|---|------|---------------- |----------------------------------------------------------|
| 0+| 32 | count | int: number of flick elements in this flick |
|12+| 32 | flick | int: index into `flick` subtable for first flick element |
|16+| 32 | id | str: flick id |
| 4+| 32 | flick | int: index into `flick` subtable for first flick element |
| 8+| 32 | id | str: flick id |

- `id`: The original string id from XML. This may be 0 to save space (i.e. omit
the string id).
Expand All @@ -440,8 +440,8 @@ For each flick element:

|| Bits | Name | Description |
|---|------|---------------- |----------------------------------------------------------|
| 0+| 32 | directions | list: index into `list` section with direction list |
| 8+| 32 | keyId | str: id of key |
| 0+| 32 | directions | list: index into `list` section with direction sequence |
| 4+| 32 | keyId | str: id of key |

If this section is present, it must have a 'flick element' at position zero with
directions=0, flags=0, and to=0 meaning 'no flick'.
Expand Down

0 comments on commit 0731c7b

Please sign in to comment.