-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2467 from quran/inline_arabic_font
- 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