Skip to content

Commit dbf395d

Browse files
committed
v2.0.3
1 parent 9e56c5e commit dbf395d

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## [2.0.3] - 2018-09-14
6+
### Changed
7+
- Updated README
8+
9+
### Fixed
10+
- #6 Fix podspec sysntax. Thanks to @Jyrno42
11+
512
## [2.0.2] - 2018-08-31
613
### Changed
714
- iOS: Give `flatHeights` better performace by avoiding multiple creation of NSTextStorage.

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@
55

66
Measure text accurately before laying it out and get font information from your App (Android and iOS).
77

8-
The text to be measured is required, the rest of the parameters supported are optional and work in the same way as with React Native:
8+
There are two main functions: `flatHeights` to obtain the height of different blocks of text simultaneously, optimized for components such as `<FlatList>`.
9+
10+
The other one is `measure`, which gets detailed information about one block of text:
11+
12+
- The width used by the text, with an option to calculate the real width of the largest line.
13+
- Height, with or without paddings.
14+
- The number of lines.
15+
- The width of the last line, if required, useful to save space with "See more..." style labels or time stamps.
16+
17+
The width and height are practically the same as those received from the `onLayout` event of a `<Text>` component with the same properties.
18+
19+
In both functions, the text to be measured is required, but the rest of the parameters supported are optional and work in the same way as with React Native:
920

1021
- `fontFamily`
1122
- `fontSize`
@@ -18,17 +29,6 @@ The text to be measured is required, the rest of the parameters supported are op
1829
- `allowFontScaling`
1930
- `width`: Constraint for automatic line-break based on text-break strategy.
2031

21-
There are two main functions, one to obtain the height of different blocks of text simultaneously, optimized for components such as `<FlatList>`.
22-
23-
The other one gets detailed information about a block of text:
24-
25-
- The width used by the text, with an option to calculate the real width of the largest line.
26-
- Height, with or without paddings.
27-
- The number of lines.
28-
- The width of the last line, if required, useful to save space with "See more..." style labels or time stamps.
29-
30-
Both, width and height, are practically the same as those received from the `onLayout` event of a `<Text>` component with the same properties.
31-
3232
In addition, the library includes functions to obtain information about the fonts visible to the App.
3333

3434
rnTextSize is WIP, but if it has helped you, please support my work with a star :star2: or [buy me a coffee][bmc-url].
@@ -190,7 +190,7 @@ flatHeights(options: TSHeightsParams): Promise<number[]>
190190

191191
Calculate the height of each of the strings in an array.
192192

193-
This is an alternative to `measure` designed for cases in which you have to calculate the height of numerous text blocks with common characteristics (width, font, etc), a Typical case with `<FlatList>`.
193+
This is an alternative to `measure` designed for cases in which you have to calculate the height of numerous text blocks with common characteristics (width, font, etc), a Typical use case with `<FlatList>`.
194194

195195
The measurement uses the same algorithm as `measure` but it returns only the height of each block and, by avoiding multiple steps through the bridge, it is faster... _much faster_ on Android!
196196

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-text-size",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "Measure text accurately before laying it out and get font information from your App",
55
"main": "index.js",
66
"keywords": [

0 commit comments

Comments
 (0)