-
Notifications
You must be signed in to change notification settings - Fork 882
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Kitab font for inline Arabic translation
This uses the Kitab font for the inline ayah translation view, just like the full screen translation view does. This helps fix artifacts and strange issues on older phones with how some characters are rendered. Also made the Arabic text slightly larger in this view. Fixes #2459.
- Loading branch information
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/quran/labs/androidquran/ui/helpers/TypefaceWrappingSpan.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.quran.labs.androidquran.ui.helpers | ||
|
||
import android.graphics.Typeface | ||
import android.text.TextPaint | ||
import android.text.style.MetricAffectingSpan | ||
|
||
class TypefaceWrappingSpan(private val typeface: Typeface) : MetricAffectingSpan() { | ||
|
||
override fun updateDrawState(ds: TextPaint) { | ||
ds.typeface = typeface | ||
} | ||
|
||
override fun updateMeasureState(paint: TextPaint) { | ||
paint.typeface = typeface | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters