Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README #36

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ The [Memory footprint evaluator][memory-footprint] allows you to check watch
faces ahead of submission to Play or to incorporate memory usage checking into
your tools and processes.

## Watch Face Format optimizer

The [Watch Face Format optimizer][optimizer] is a tool which can be incorporated
into your work flow to reduce the memory usage of your watch face at runtime, by
optimizing aspects of your WFF XML and your resources.

## Samples

For WFF samples, please see the [Wear OS Samples repository][samples] on GitHub.
Expand All @@ -48,4 +54,5 @@ Watch Face Format is distributed under the Apache 2.0 license, see the
[samples]: https://github.com/android/wear-os-samples/tree/main/WatchFaceFormat
[xsd-specs]: third_party/wff/specification/documents/1/
[xsd-validator]: third_party/wff/README.md
[wff-features]: https://developer.android.com/training/wearables/wff/features
[wff-features]: https://developer.android.com/training/wearables/wff/features
[optimizer]: tools/wff-optimizer/
32 changes: 21 additions & 11 deletions tools/wff-optimizer/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
Watch Face Format Optimizer
# Watch Face Format Optimizer

This tool applies the following optimizations, designed to reduce the runtime
memory footprint of an Android Watch Face Format watch face:
memory footprint of a WatchFace Format watch face:

1. Crops and resizes BitmapFonts, adding margins to the Character
tag to ensure alignment.
1. Crops and resizes `BitmapFonts`, adding margins to the `Character` tag to
ensure alignment.

2. Crops and resizes PartImage nodes, adjusting the pivot if
needed.
2. Crops and resizes `PartImage` nodes, adjusting the pivot if needed.

3. Attempts to quantize images to RGB565 where there will be no
noticeable loss of fidelity.
3. Attempts to quantize images to RGB565 where there will be no noticeable loss
of fidelity.

4. De-duplicates image resources after cropping, etc...

Usage: wff_optimizer.jar --source PATH/TO/UNZIPPED/APK
## Building the tool

That will run the optimizations in place. You can add --verbose to observe what
the tool is doing.
```shell
./gradlew :wff-optimizer:jar
```

## Example usage

The following command will run the optimizations in place:

```shell
java -jar wff_optimizer.jar --source PATH/TO/UNZIPPED/APK
```

Add `--verbose` to observe what the tool is doing.
Loading