59 Commits

Author SHA1 Message Date
Jeff Verkoeyen
1c432db2e2 [Typography] Remove font loader setter.
PiperOrigin-RevId: 604499858
2024-02-05 18:55:43 -08:00
Jeff Verkoeyen
729ff03c87 [Typography] Delete unused display font styles.
PiperOrigin-RevId: 603745142
2024-02-02 11:42:18 -08:00
Nobody
572585b60a Fixed up imports for Typography
PiperOrigin-RevId: 474189786
2022-09-13 20:34:20 -07:00
Alyssa Weiss
e4d313ee44 Delete MDCTypography boldFontFromFont and italicFontFromFont APIs.
PiperOrigin-RevId: 395578910
2021-09-08 16:10:06 -07:00
Alyssa Weiss
1b69273926 Delete MDCTypography font opacities.
PiperOrigin-RevId: 394494448
2021-09-02 10:44:20 -07:00
Alyssa Weiss
6ccb268a37 Move FontScaler APIs in MDCTypography to a separate directory.
PiperOrigin-RevId: 390642325
2021-08-13 10:33:45 -07:00
Alyssa Weiss
2ae9094c8b Remove setFontLoader from MDCTypography.h, now only available through MDCTypography:FontLoader.
PiperOrigin-RevId: 376884939
2021-06-01 11:53:42 -07:00
Alyssa Weiss
9f7c0683c8 Add separate target for MDCTypography setFontLoader. SetFontLoader will later be removed from the MDCTypography target and only be available through MDCTypographyFontLoader. This target will eventually be deprecated and deleted.
PiperOrigin-RevId: 374325657
2021-05-17 18:52:18 -07:00
Jeff Verkoeyen
fbb1f20aa2 Internal change
PiperOrigin-RevId: 332151481
2020-09-16 21:01:21 -07:00
Jeff Verkoeyen
d7ff705337 Drop support for iOS 9.
PiperOrigin-RevId: 326015653
2020-08-11 07:21:40 -07:00
Randall Li
afbd7351b5 [Typography] Using safeSharedApplication in test (#8815)
I needed to change this to run test locally in my simulator.

I'm not sure why this wasn't caught in CI.
2019-11-15 07:31:27 -08:00
Robert Moore
2550aa00b3 [Typography] Remove checks for systemFontOfSize:weight:. (#8581)
Removing conditional checks and guards for the API since we now support iOS 9
as the minimum iOS version and no longer support Xcode 9.

Part of #8580
2019-10-15 00:29:35 -04:00
Robert Moore
d8858723ef
[Typography] Fix scaling test. (#8477)
Corrects a bug in an font scaling test that assumed the test host had its
content sizes category set to `UIContentSizeCategoryLarge`.

Discovered while authoring #8476.
2019-09-23 10:33:34 -04:00
featherless
ec4b19d064
[Typography] Add mdc_scaledFontForTraitEnvironment. (#7471)
This method's logic exists frequently throughout our componentry and theming extensions as a mechanism for scaling a scalable font with the preferred content size category.

This change introduces a new API that can be invoked by each of the components and theming extensions that support Dynamic Type.

Part of https://github.com/material-components/material-components-ios/issues/7470
2019-05-24 15:19:38 -04:00
featherless
50bd0a4dc5 [Typography] Implement copy semantics on the UIFont's mdc_scalingCurve. (#7476)
Prior to this change, mdc_scalingCurve was implemented using retain semantics insteaad of copy semantics. This potentially enabled a class of surprising bugs if mutable dictionaries were being assigned and then modified after the fact.

After this change, mdc_scalingCurve implements copy semantics as its public API defines.

The added test was verified to fail prior to this PR's change, and passes with the PR's change.

Closes https://github.com/material-components/material-components-ios/issues/7472
2019-05-24 01:58:40 -04:00
ianegordon
96a741b315
[Typography] Add new typography scheme with scalable fonts (#6873)
Adds a new scheme that vends fonts with an associated scaling curve.

This is a BREAKING CHANGE due to a new, required property in the MDCTypographyScheming protocol.
To easily migrate, clients can add the following method to their custom implementations of MDCTypographyScheming.

- (BOOL)mdc_adjustsFontForContentSizeCategory {
  return NO;
}
2019-03-21 17:17:43 -04:00
ianegordon
80db06984b
[Typography] Add Font Scaler (#6871)
MDCFontScalar allows us to add an associated scaling curve to UIFont instances. This scaling curve allows us to support Dynamic Type by creating differently sized fonts based on a UIContentSizeCategory.

MDCFontScaler offers similar, but limited, functionality as UIKit's UIFontMetrics.
2019-03-19 12:22:17 -04:00
Robert Moore
32904609b0
[Typography] Add basic Snapshot tests. (#6828)
Adding Snapshot tests for fonts and opacities.

Closes #6802
2019-03-11 21:36:01 -04:00
Robert Moore
800188a649
{clang-format} Format the components. (#6347)
This is a follow-up to https://github.com/material-components/material-components-ios/pull/6027

```
find components \( -name "*.h" -or -name "*.m" \) | xargs clang-format -i
```
2019-01-23 11:08:43 -05:00
Robert Moore
03f3351ad5
Global replace of single-precision floats with CGFloat casts. (#5718)
Replacing all non-integral, single-precision floating point literals with double-precision values explicitly cast to CGFloat.  For example, `0.1f` should become `(CGFloat)0.1`.

Regex used:
```
([0-9]*\.)([0-9]*?)([1-9]+)([0-9]*?)[fF]
```

PiperOrigin-RevId: 220683126
2018-11-12 10:50:01 -05:00
Robert Moore
74a27253e8
Global replace of integral single-precision literals with integer literals. (#5709)
Global replace of integral single-precision literals with integer literals.

Regular expression used:
```perl
/[^\w]([0-9]+)\.[0]*[fF]/$1/
```
2018-11-08 14:02:04 -05:00
Robert Moore
64d6535f2a
[Typography] Cache standard font for text style. (#5533)
Scrolling the `MDCSelfSizingStereoCell` while using the Time Profiler showed that `+[UIFont mdc_standardFontForMaterialTextStyle:]` was consuming about 11% (iPhone 4S) of the used CPU time.  

Because the `UIFont` returned for a specific `MDCFontTextStyle` should always be the same (they are created with exactly the same `UIFontDescriptor` values), the font can be cached using the `MDCFontTextStyle` as a key. This nearly eliminates any time required for these font retrievals (excepting the first call), and increased CPU time dedicated to the main thread by 8% (iPhone 4S). 

Reduces time spent loading fonts when scrolling Collection Cells: 11% on iPhone 4S/iOS 9.3.6, 2% on iPhone 5c/iOS 10.3.3

||Original|Cached|
|--|--|--|
|iPhone 4S/iOS 9.3.5|![typography-original](https://user-images.githubusercontent.com/1753199/47525482-60af4680-d86b-11e8-8995-bd13914385da.png)|![typography-cached](https://user-images.githubusercontent.com/1753199/47525491-64db6400-d86b-11e8-9850-98e114c60724.png)|
|iPhone 5c/iOS 10.3.3|![typo-orig-min-5c](https://user-images.githubusercontent.com/1753199/47526162-f1d2ed00-d86c-11e8-9b53-6d6b018d433f.png)|![typo-cached-min-5c](https://user-images.githubusercontent.com/1753199/47526168-f5ff0a80-d86c-11e8-8061-48375b255817.png)|
2018-11-06 08:43:22 -05:00
featherless
d5c064fdff
[automated] Fix more copyright stanzas. (#4990)
Our creativity knows no bounds.

### Find

```
/\*
 *Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 *
 *Licensed under the Apache License,? Version 2\.0 \(the "License"\);
 *you may not use this file except in compliance with the License\.
 *You may obtain a copy of the License at
 *
 *http://www\.apache\.org/licenses/LICENSE-2\.0
 *
 *Unless required by applicable law or agreed to in writing,? software
 *distributed under the License is distributed on an "AS IS" BASIS,?
 *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,? either express or implied\.
 *See the License for the specific language governing permissions and
 *limitations under the License\.
 *\*/
```

```
/\*
 *Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 *Licensed under the Apache License, Version 2\.0 \(the "License"\);
 *you may not use this file except in compliance with the License\.
 *You may obtain a copy of the License at
 *http://www\.apache\.org/licenses/LICENSE-2\.0
 *Unless required by applicable law or agreed to in writing, software
 *distributed under the License is distributed on an "AS IS" BASIS,
 *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 *See the License for the specific language governing permissions and
 *limitations under the License\.
 *\*/
```

```
/\*

 *Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 *
 *Licensed under the Apache License, Version 2\.0 \(the "License"\);
 *you may not use this file except in compliance with the License\.
 *You may obtain a copy of the License at
 *
 *http://www\.apache\.org/licenses/LICENSE-2\.0
 *
 *Unless required by applicable law or agreed to in writing, software
 *distributed under the License is distributed on an "AS IS" BASIS,
 *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 *See the License for the specific language governing permissions and
 *limitations under the License\.

 *\*/
```

```
/\*
 *Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 *
 *Licensed under the Apache License, Version 2\.0 \(the "License"\);
 *you may not use this file except in compliance with the License\.
 *You may obtain a copy of the License at
 *
 *http://www\.apache\.org/licenses/LICENSE-2\.0
 *
 *Unless required by applicable law or agreed to in writing, software
 *distributed under the License is distributed on an "AS IS" BASIS,
 *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 *See the License for the specific language governing permissions and
 *limitations under the License\.
 *\*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 +Licensed under the Apache License, Version 2\.0 \(the "License"\);
 +you may not use this file except in compliance with the License\.
 +You may obtain a copy of the License at

 +http://www\.apache\.org/licenses/LICENSE-2\.0

 +Unless required by applicable law or agreed to in writing, software
 +distributed under the License is distributed on an "AS IS" BASIS,
 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 +See the License for the specific language governing permissions and
 +limitations under the License\. *\*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 +Licensed under the Apache License, Version 2\.0 \(the "License"\);
 +you may not use this file except in compliance with the License\.
 +You may obtain a copy of the License at

 +http://www\.apache\.org/licenses/LICENSE-2\.0

 +Unless required by applicable law or agreed to in writing, software
 +distributed under the License is distributed on an "AS IS" BASIS,
 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 +See the License for the specific language governing permissions and
 +limitations under the License\.
 *\*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 Licensed under the Apache License, Version 2\.0 \(the "License"\)
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

### Replace

```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
2018-08-31 16:09:12 -04:00
featherless
2181084272
[automated] Standardize our open source license stanza to what Xcode generates. (#4985)
Removes the need to copy-paste stanzas from other files anymore as we'll rely on #4478 to generate the correct stanza for us instead.

This was an automated change generated by running a find-and-replace regular expression:

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at

http://www\.apache\.org/licenses/LICENSE-2\.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at
 http://www\.apache\.org/licenses/LICENSE-2\.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
2018-08-31 12:13:07 -04:00
Will Larche
53876c3dca
[Typography] 3rd PR on font equality (#4435)
* [TextFields] Adding todos for #4331

* [TextFields] Creating simple equality files.

* [TextFields] Prevents fonts that are almost the same but not quite from messing up the rendering.

* [Typography] Adding tests for font equality.

* [TextFields] Formatting.

* [Typography] Adding Math to the bazel file.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Comment.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Updating podspec.

* [Typography] Asserts for bazel.

* [Typography] Logging for tests.

* [Typography] Loggin.g

* [Typography] Removing logging and the deeper check.

* [Typography] Making simple equality a category.

* [TextFields] Using new method.
2018-06-26 11:45:13 -07:00
Yarden Eitan
45c6fba187 Revert "[TextFields] Prevents functionally equivalent fonts from causing rendering jumps (#4344)"
This reverts commit de44925eb609f1a06c6529fbd06ba7d5f80dcfa9.
2018-06-07 11:17:31 -04:00
Will Larche
de44925eb6
[TextFields] Prevents functionally equivalent fonts from causing rendering jumps (#4344)
* [TextFields] Adding todos for #4331

* [TextFields] Creating simple equality files.

* [TextFields] Prevents fonts that are almost the same but not quite from messing up the rendering.

* [Typography] Adding tests for font equality.

* [TextFields] Formatting.

* [Typography] Adding Math to the bazel file.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Comment.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Updating podspec.

* [Typography] Asserts for bazel.

* [Typography] Logging for tests.

* [Typography] Loggin.g

* [Typography] Removing logging and the deeper check.
2018-06-05 15:32:58 -04:00
ianegordon
5f0e12550d
[Typography] Add unit test to improve coverage (#4198)
* Add test to give full coverage to typography

* Explicitly note private directory

* Missing comma
2018-05-22 16:18:27 -04:00
Robert Moore
f4cc724e54
[Typography] Suppress pointer warning in tests (#2805)
Internal builds are issuing a warning that `&UIFontWeightMedium` will
never be NULL, although this is incorrect on iOS versions below 8.2.
2018-01-04 20:02:14 -05:00
Robert Moore
25de372807 [Tests/Catalog] Suppress partial availability warnings (#2780)
* [Tests] Suppress partial availability warnings

`- UIFont systemFontOfSize:weight:` was not introduced until iOS 8.2. Although
most of the code was already performing runtime checks on the selector, the
compiler still emits warnings for the use of the selectors.

Closes 2779

* Use systemFontOfSize: instead of fontWithName:size:
2018-01-02 13:59:38 -05:00
Yurii Samsoniuk
edd0dbc1b9 [Typography] Match large font family on iOS 9+ (#1880)
* Use the same font family when loading fonts as iOS does by default.

Resolves #1805.

* Format test.

* Format test.

* Updated comment.
2017-08-23 16:14:01 -04:00
ianegordon
2bda2c118e [Typography] Workaround for medium system font on iOS 8 (#1292)
* [Typography] Workaround for medium system font on iOS 8

* Add issue number
2017-04-04 17:35:06 -04:00
Randall Li
bbfad4f894 [Typography] Added fallback logic for getting bold/italic fonts so that if there are no fonts then it returns the system bold/italic fonts. (#1277) 2017-03-24 15:27:24 -04:00
Will Larche
8c5350de31 [All] Formatting. (#1269) 2017-03-22 12:18:15 -04:00
Randall Li
7ddf3fb0c6 [Typography] added boldFontFromFont: and italicFontFormFont: (#1261) 2017-03-20 15:42:04 -04:00
Randall Li
f922779b29 [Typography] added boldItalic font to optional protocol of the TypographyFontLoading protocol (#1252)
* [Typography] added boldItalic font to optional protocol of the TypographyFontLoading protocol

* revert cocoa pods version number

* fixed bold/regular variable name

* added comment for font size must be greater than  0
2017-03-14 19:03:58 -04:00
Ian Gordon
af8ca9ed1a Merge branch 'release-candidate' 2017-03-09 12:54:43 -05:00
Randall Li
9fa1bf999b [Typography] Make system font return medium and light versions of Helvetica instead of regularSystemFont. (#1246) 2017-03-09 12:53:24 -05:00
Ian Gordon
dce51db0be [Typography] Cannot set a nonnull parameter to nil 2017-03-09 05:17:35 -05:00
Randall Li
36ca5ec407 [Typography] Added isLargeForContrastRatio to protocol (#1232)
* [Typography] Added isLargeForContrastRatio so that we can make the font tell us if it is has large fonts.

* lint

* added fuller doc

* fixed system font loader to return optional protocol method isLargeForContrastRatio

* removed class method

* moved bold and italic to be optional properties.

* Update MDCTypography.m

* added UIFontWeightMedium weak check.
2017-03-07 16:58:29 -05:00
Randall Li
6485223703 switch it to a objc test (#1226) 2017-03-01 10:28:45 -05:00
Randall Li
975680a9cb Added bold and italics to the system fontloader and MDCTypographyFontLoader protocol (#1225)
* Added bold and italics to the system fontloader and MDCTypographyFontLoader protocol

* added test for system font loader
2017-02-28 16:43:06 -05:00
ianegordon
0f422df49a [Typography] Remove Font Loaders (#1035)
* [Typography] Remove Font Loaders

* Unit test cleanup

* Update storyboards
2016-12-13 23:37:19 -05:00
Adrian Secord
1e965bf573 Revert "[Typography] Removes the runtime inspection that uses Roboto if it can be found (via MDCRobotoFontLoader) (#713)"
Partial revert of only the implementation and unit test, not docs.

This reverts commit 6834ae3efc45a87933e6fb6cdfdc942c0ffbe509.
2016-12-13 14:24:37 -05:00
Randall Li
6834ae3efc [Typography] Removes the runtime inspection that uses Roboto if it can be found (via MDCRobotoFontLoader) (#713)
* [Typography] Removes the runtime inspection that uses Roboto if it can be found (via MDCRobotoFontLoader) (#712)

* [Typography] Removed runtime inspection for MDCRobotoFontLoader and using Roboto if found.

* corrected readme's

* [Typography] Removed runtime inspection for MDCRobotoFontLoader and using Roboto if found.

Summary:
Corrected readme's
Fixed tests

Reviewers: O1 Material components iOS!

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1672

* Switch to roboto in apppDel

* Removed default clause in Typography readme and added similar clause to RobotoFontLoader warning about font assets being added to your App

* sort imports for appdel

* fix app delegate imports

* removed roboto font loader form app del

* reorder swift objective c examples
2016-12-12 17:51:45 -05:00
randallli
56c220b098 Revert "[Typography] Removes the runtime inspection that uses Roboto if it can be found (via MDCRobotoFontLoader) (#712)"
This reverts commit 6c9c77a0415664854851f6c9c8b808d2d2c58c3d.
2016-09-30 17:44:29 -04:00
Randall Li
6c9c77a041 [Typography] Removes the runtime inspection that uses Roboto if it can be found (via MDCRobotoFontLoader) (#712)
* [Typography] Removed runtime inspection for MDCRobotoFontLoader and using Roboto if found.

* corrected readme's

* [Typography] Removed runtime inspection for MDCRobotoFontLoader and using Roboto if found.

Summary:
Corrected readme's
Fixed tests

Reviewers: O1 Material components iOS!

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1672

* Switch to roboto in apppDel

* Removed default clause in Typography readme and added similar clause to RobotoFontLoader warning about font assets being added to your App

* sort imports for appdel
2016-09-30 16:36:05 -04:00
randallli
ffd56e6d30 [FontDiskLoader, RobotoFontLoader, Typography] The results of some readability code reviews from some googlers.
Summary:
internal reference: cl/121301531
  - Renamed some of the FontDiskLoader's APIs to be more readable.
    - |registerFont| renamed to |load|
    - |unregisterFont| renamed to |unload|
    - |isRegistered| renamed to |loaded|
  - Made FondDiskLoader thread safe.
  - Made fontName and fontURL copy, readonly, nonnull properties.
  - More comments across the board and other miscellaneous Objective C Readability issues.
  - Readded to be deprecated setFontName and other APIs.

Internal implementation detail refactors:
  - Removed references to 'resource' as that was part of the old name of the FontDiskLoader class.
  - Using dispatch queue for |loaded| protection instead of @syncronized. Also using class method for |setLoaded|.
  - Fixed tests to make them not set the name of the font
  - Added more descriptive messages for tests

Reviewers: O1 Material components iOS, iangordon

Reviewed By: O1 Material components iOS, iangordon

Subscribers: iangordon

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1265
2016-09-07 12:44:47 -04:00
Adrian Secord
8c3af252be Adding AUTHORS and removing CONTRIBUTORS.txt.
We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has...

Summary:

We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has no legal change, since the contributors always retained their copyright despite the copyright notice, but it's a nice acknowledgement.

Changed copyright statement to include non-Google authors.

Command run:

find * \( -name '*\.m' -or -name '*\.h' -or -name '*\.swift' \) -and -not \( -path 'scripts/external*' -name Pods  \) -print0 | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'

Added non-source files.

Command run:

grep -Rl 'Copyright .* Google Inc' * --exclude-dir scripts/external --null | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'

Reviewers: featherless, O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1415
2016-08-08 08:16:37 -07:00
randallli
cbbcb7271c [Typography]! Finished splitting out RobotoFontLoader and FontDiskLoader from Typography
Summary:
Breaking changes:
Typography Component will no longer depends on Roboto Font Loader Component.

Instructions on how to fix:
Depend on Roboto Font Loader directly if you need to use it.

Reviewers: ajsecord, #mdc_ios_owners

Reviewed By: ajsecord, #mdc_ios_owners

Subscribers: lpromero, featherless

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D459
2016-04-08 16:27:07 -04:00