An android library with a custom TextView for displaying Egyptian hieroglyphs by using the GlyphX code.
You can test the THOTH Library using the THOTH Example App.
This library uses the GlyphX code for encoding Hieroglyphs.
A library for converting GlyphX to MdC and back is stored here: GlyphConverter
Tip
If you only want to calculate the Dimensions and Positions (Bounds) of each sign, then you can use the MAAT-library:
cristmasbox/MAAT
Add this to your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Then add this dependency to your build.gradle.kts file:
dependencies {
implementation("com.github.cristmasbox:THOTH:1.0.0")
}
Note
For the implementation for other build systems like Groovy see here
Download the THOTH_debug_versionname.aar file from this repository, create a libs folder in your project directory and paste the file there. Then add this dependency to your build.gradle.kts file:
dependencies {
implementation(files("../libs/THOTH_debug_versionname.aar"))
}
Important
If you renamed the .aar file you also have to change the name in the dependencies
Put this code into your layout.xml:
<com.blueapps.thoth.ThothView
android:id="@+id/thothView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="40sp"
app:backgroundColor="#fff"
app:primarySignColor="#000"
app:altTextColor="#000"
app:altTextSize="20sp"
app:altText="Km.t m in.t hapi"
app:showAltText="true"
app:verticalOrientation="middle"
app:writingLayout="lines" />
Here I will explain all the possible xml Attributes:
android:textSize: Height of one line of big hieroglyphs. Default:200pxapp:verticalOrientation: This parameter can only have three values and defines the vertical position of smaller signs (liken): Default:middletop: Put signs to the top of the line In the code this equals0middle: Center signs vertically In the code this equals1bottom: Drop signs on Baseline In the code this equals2
app:writingLayout: This parameter only have two possible values and determines if signs should be written in lines or in columns: Default:lineslines: Write signs in lines In the code this equals0columns: Write signs in columns In the code this equals1
app:altText: Alternative text which is displayed when hieroglyphs are loaded into memory.app:showAltText: Determines whether the alternative text should be displayed or not. Default:trueapp:altTextSize: Sets the text size of the alternative Text. Default: 1/2 of theandroid:textSizeapp:altTextColor: Defines the color of the alternative Text. Default:#000000app:primarySignColor: Defines the color of the hieroglyphs. Default:#000000app:backgroundColor: Defines the background color of the view. Default:transparent
To change the Attributes during runtime, you can call the getter and setter for the values. For example:
binding.thothView.setTextSize(200); // Set the value for the textSize in pixels
You can also use some other functions which are explained here:
getText(): Returns the hieroglyphic text asGlyphX-String.isAltTextTested(): Returns whether the view is inAltTextTesting-Mode or not.setText(String text): Change the hieroglyphic text during runtime by transferring the text asGlyphX-String.testAltText(boolean b): Enable or disableAltTextTesting-Mode. IfAltTextTesting-Mode is enabled, the hieroglyph will not be rendered and the view will act like if the hieroglyphs are currently loaded into memory. This is useful for testing how the alternative text looks like.
Note
Currently the view isn't displaying the alternative text correctly.
Especially when the altTextSize is very big, the text is not centered vertically.
This is the first release of the THOTH library.
Databases are updated. Now it supports numbers as ids. This means you cant type in
<sign id="500"/>
instead of typing
<v><h><sign id="V1"/><sign id="V1"/><sign id="V1"/></h><h><sign id="V1"/><sign id="V1"/></h></v>