You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/commodetto/Creating fonts for Moddable applications.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Each font asset consists of a (.png) glyph file and a corresponding font metrics
13
13
This allows anti-aliased or non-anti-aliased font sets to be generated as desired. The Poco renderer in the Moddable SDK does not implement a font scaler. Consequently, each required font size/weight must be generated and included as an asset in the application.
14
14
15
15
BMFont allows an arbitrary number of glyphs in the font.
16
-
Moddable supports non-contiguous glyphs ranges allowing the developer or graphic designer to create an efficient font asset with just the characters needed for the application. This can significant reducing asset storage size.
16
+
Moddable supports non-contiguous glyph ranges allowing the developer or graphic designer to create an efficient font asset with just the characters needed for the application. This can significantly reduce asset storage size.
17
17
18
18
Fonts are generated in black. This allows the Moddable SDK build tools to create alpha masks of the characters. To render the fonts in color, applications apply styles.
The `adaptInvalid` function takes a rectangle argument specifying an area inside the `PixelsOut` area and modifies them rectangle as needed to make it a valid update area for the this PixelsOut. The `adaptInvalid` function is necessary because some display controllers are only able to update the display in certain quanta. For example, one display requires that the x coordinate and width are even numbers, another display can only update complete horizontal scan lines, and another updates the entire display even if only a single pixel changed.
378
+
The `adaptInvalid` function takes a rectangle argument specifying an area inside the `PixelsOut` area and modifies the rectangle as needed to make it a valid update area for the PixelsOut. The `adaptInvalid` function is necessary because some display controllers are only able to update the display in certain quanta. For example, one display requires that the x coordinate and width are even numbers, another display can only update complete horizontal scan lines, and another updates the entire display even if only a single pixel changed.
379
379
380
380
let r = renderer.rectangle(x, y, w, h);
381
381
pixelsOut.adaptInvalid(r);
@@ -478,7 +478,7 @@ RLE-encoded bitmaps are smaller, reducing the amount of ROM required for assets.
478
478
479
479
The `RLE4Out` class may be used on the device. More commonly, however, a bitmap is RLE-encoded and written to storage at build time; this avoids the time and memory required to encode the image on the device, while saving storage space.
480
480
481
-
The `rle4encode` tool in the Moddable SDK compressed 4-bit grayscale BMP files using the `RLE4Out` class. The `compressbmf` tool applies the RLE4Out to each individual glyph in a BMF font.
481
+
The `rle4encode` tool in the Moddable SDK compresses 4-bit grayscale BMP files using the `RLE4Out` class. The `compressbmf` tool applies the RLE4Out class to each individual glyph in a BMF font.
482
482
483
483
The `RLE4Out` class does not implement the optional `continue` function.
484
484
@@ -793,13 +793,13 @@ The renderer's `adaptInvalid` function is used to adjust the update area defined
793
793
renderer.begin(r.x, r.y, r.w, r.h);
794
794
...
795
795
796
-
Applications written to work with a single display controlled be able to safely ignore `adaptInvalid` by applying its constraints themselves. Code written to work with more than a single display controller will likely need to use `adaptInvalid` for reliable updates to subsections of the display.
796
+
Applications written to work with a single display controller should be able to safely ignore `adaptInvalid` by applying its constraints themselves. Code written to work with more than a single display controller will likely need to use `adaptInvalid` for reliable updates to subsections of the display.
797
797
798
798
The Piu user interface framework calls `adaptInvalid` when necessary, so application scripts don't need to call it directly.
799
799
800
800
## Pixel format conversion
801
801
802
-
Commodetto provides a pixel format conversion capability intended primarily for use in tools that process images running on a computer. They are used, for example, by the `image2cs` and `png2bmp` tools in the Moddable SDK. The converters are small and efficient, and so may also be use in deployments to microcontrollers.
802
+
Commodetto provides a pixel format conversion capability intended primarily for use in tools that process images running on a computer. They are used, for example, by the `image2cs` and `png2bmp` tools in the Moddable SDK. The converters are small and efficient, and so may also be used in deployments to microcontrollers.
Copy file name to clipboardExpand all lines: documentation/commodetto/poco.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -349,7 +349,7 @@ For displays that require a different output format, the display driver is respo
349
349
Poco supports 1-bit monochrome and 4-bit gray bitmaps as sources for rendering to all pixel formats. In addition, the configured destination pixel format is always supported as a source format. For example, when the rendering pixel format is 16-bit RGB565 little-endian, supported source pixel formats are 1-bit monochrome, 4-bit gray, and 16-bit RGB565 little-endian.
350
350
351
351
### Compressed pixel formats
352
-
Poco implements support for two compressed pixel format.
352
+
Poco implements support for two compressed pixel formats.
353
353
354
354
The first is a weighted run-length compression of 4-bit gray bitmaps. These are commonly used for anti-aliased fonts and image masks. They use the `CommodettoBitmap` and `PocoBitmap` data structures with the pixel format set to `(kCommodettoBitmapGray16 | kCommodettoBitmapPacked)`.
355
355
@@ -818,7 +818,7 @@ void PocoDrawFrame(Poco poco,
818
818
PocoDimension w, PocoDimension h);
819
819
```
820
820
821
-
`PocoDrawFrame` renders a compressed image stored in the Moddable variant of the ColorCell algorithm. The image to render is pointed to by the `data` argument with a byte count specified by the `dataSize` argument. The image is rendered at the location specified specified by the `x` and `y` arguments. The source dimensions (unclipped size) of the compressed image are given by the `w` and `h` arguments.
821
+
`PocoDrawFrame` renders a compressed image stored in the Moddable variant of the ColorCell algorithm. The image to render is pointed to by the `data` argument with a byte count specified by the `dataSize` argument. The image is rendered at the location specified by the `x` and `y` arguments. The source dimensions (unclipped size) of the compressed image are given by the `w` and `h` arguments.
0 commit comments