This library can be used to create a DropCap in your app! A DropCap is the first letter of a paragraph that's of a much bigger size than the rest that follow. The formatting is such that the DropCap spans (drops down) to cover the few lines following the first.
If there are not enough lines to wrap the DropCap
then the style on the first character will default to the style
of the copy text. This styling is to keep the text consist when a DropCap
is not present.
To start using this library, add these lines to the build.gradle
of your project:
repositories {
jcenter()
}
dependencies {
compile 'com.novoda:drop-cap:<latest-version>'
}
Simply add DropCapView
to one of your layout xml files and use the following xml attributes for customization.
<attr name="numberOfDropCaps" format=“integer” />
<attr name="lineSpacingExtra" format="dimension" />
<attr name="dropCapTextSize" format="dimension" />
<attr name="dropCapTextColor" format="color" />
<attr name="dropCapFontPath" format="string" />
<attr name="copyTextSize" format="dimension" />
<attr name="copyTextColor" format="color" />
<attr name="copyFontPath" format="string" />
<attr name="android:text" />
For ease of use, the DropCapView
uses the android:text
attribute to specify text via the xml layout.
For further usage or to delve more deeply checkout the associated sample
app.
Here are a list of useful links:
- We always welcome people to contribute new features or bug fixes, here is how
- If you have a problem check the Issues Page first to see if we are working on it