GitXplorerGitXplorer
k

woff2-android

public
2 stars
3 forks
0 issues

Commits

List of commits on branch master.
Verified
370ea786df6b597ef6bacca85f8321ab00d48c9b

Update build script: add mention about NDK ver, check for valid NDK path, remove useless backslashes (#1)

vvickyleu committed a year ago
Unverified
b70f20e333a6909c8f0a7daf7f272a8eb4bd7396

README.md: Add badges

kkhoben committed 2 years ago
Unverified
d7faaa53392ccff16a002d316407d31d3abaf1e1

Setup maven publishing

kkhoben committed 2 years ago
Verified
7815e4bde971604a305543556353bce0b7524448

Add LICENSE

kkhoben committed 2 years ago
Unverified
b41d4fa81cfb3a6ff2c9ed99bd1647c576d52dfc

Minor improvements

kkhoben committed 2 years ago
Unverified
25851b2f31462f809ae1043f8fc7d40b510ca6f1

Update woff2-android with disk cache and app startup initializer

kkhoben committed 2 years ago

README

The README file for this repository.

WOFF2 Android

Maven Central License

Android woff2 typeface decoder

Installation

# Woff2 android typeface converter
implementation 'io.github.khoben.woff2-android:typeface:0.0.1'

# Or single native woff2 decoder
implementation 'io.github.khoben.woff2-android:decoder:0.0.1'

Sample usage

class MainActivity : AppCompatActivity(R.layout.main_layout) {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val editText = findViewById<EditText>(R.id.text_edit)
        // using extension
        editText.woff2Typeface(assets, "test.woff2")
        editText.woff2Typeface("path/test.woff2")
        editText.woff2Typeface(File("path/test.woff2"))
        editText.woff2Typeface(ByteArray(...))

        editText.setTypeface(Woff2Typeface.get().createFromFile("path/test.woff2"))
        editText.setTypeface(Woff2Typeface.get().createFromFile(File("path/test.woff2")))
        editText.setTypeface(Woff2Typeface.get().createFromAsset(assets, "test.woff2"))
        editText.setTypeface(Woff2Typeface.get().createFromBytes(ByteArray(...)))
    }
}

Build

  1. Setup woff2 build in build_ndk.properties

  2. Build woff2 via python script:

    python ./scripts/build_ndk.py

Make sure you have NDK version 23 and above.

License

Copyright 2022 khoben
 
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.