GithubHelp home page GithubHelp logo

ranesr / swifticons Goto Github PK

View Code? Open in Web Editor NEW
797.0 14.0 106.0 6.47 MB

🎢Swift Library for Font Icons - ★ this library

Home Page: https://ranesr.github.io/SwiftIcons/

License: MIT License

Swift 99.63% Ruby 0.24% Objective-C 0.12%
fonts font-awesome fontawesome ionic map-icon material-icons linearicons open-iconic swift font-icons

swifticons's Introduction

SwiftIcons

BuyMeACoffee

CocoaPods Platform Swift Carthage compatible

Travis License

Swift Library for Font Icons

Please ★ this library.

Now, you don't have to download different libraries to include different font icons. This SwiftIcons library helps you use icons from any of the following font icons.

  • Dripicons
  • Emoji
  • FontAwesome
  • Icofont
  • Ionicons
  • Linearicons
  • Map-icons
  • Material icons
  • Open iconic
  • State face icons
  • Weather icons
  • TypIcons

SwiftIcons supports different objects from the object library.

  • UIImage
  • UIImageView
  • UILabel
  • UIButton
  • UISegmentedControl
  • UITabBarItem
  • UISlider
  • UIBarButtonItem
  • UIViewController
  • UITextfield
  • UIStepper

Requirements

  • iOS 9.0+
  • Xcode 8

Installation

Cocoapods

CocoaPods is a dependency manager for Cocoa projects.

Make sure you have the latest version of CocoaPods by running:

$ gem install cocoapods
# (or if the above fails)
$ sudo gem install cocoapods

Update your local specs repo by running:

$ pod repo update

Add the following lines to your Podfile:

target 'YourProject' do
    use_frameworks!
    pod 'SwiftIcons', '~> 3.0'
end

Then run the following command

$ pod install

You can start using the library by importing it wherever you want

import SwiftIcons

Carthage

Carthage is a decentralized dependency manager for Cocoa projects.

Install the latest version of Carthage.

Add this line to your Cartfile:

github "ranesr/SwiftIcons" ~> 3.0

or for master,

github "ranesr/SwiftIcons" "master"

Then run carthage update --platform ios and add the built framework to your project by following these instructions from Carthage.

Manually

Copy all the files from Source folder. Link to files.

  • SwiftIcons.swift
  • Dripicons.ttf
  • Emoji.ttf
  • FontAwesomeBrands.ttf
  • FontAwesomeRegular.ttf
  • FontAwesomeSolid.ttf
  • Icofont.ttf
  • Ionicons.ttf
  • Linearicons.ttf
  • MapIcons.ttf
  • MaterialIcons.ttf
  • OpenIconic.ttf
  • Stateface.ttf
  • WeatherIcons.ttf
  • TypIcons.ttf

Check to import all ttf files in project, "Project" > "Target" > "Copy Bundle Resources"

Library Reference

You can check library reference documentation here.

Usage

  • No more image icons any more

There are different font types for each of the font icons

Font Icons Version Font Types Icons
Dripicons 2.0 dripicons dripicons
Emoji emoji emoji
FontAwesome 5.1.0 fontAwesome fontAwesome
Icofont 1.0.0 Beta icofont icofont
Ionicons 2.0.1 ionicons ionicons
Linearicons 1.0.0 linearIcons linearIcons
Map-icons 3.0.2 mapicons mapicons
Material icons 2.2.0 googleMaterialDesign googleMaterialDesign
Open iconic 1.1.1 openIconic openIconic
State face icons state state
Weather icons 2.0.10 weather weather
TypIcons 2.0.7 TypIcons Typicons

When setting an icon to any object, you have to mention which font type it is and then select which icon you want to set from that particular font icon.

UIImage

import SwiftIcons

UIImage.init(icon: .emoji(.airplane), size: CGSize(width: 35, height: 35))

// Icon with colors
UIImage.init(icon: .emoji(.airplane), size: CGSize(width: 35, height: 35), textColor: .red)
UIImage.init(icon: .emoji(.airplane), size: CGSize(width: 35, height: 35), textColor: .white, backgroundColor: .red)

// Stacked icons with bigger background
UIImage.init(bgIcon: .fontAwesomeRegular(.circle), topIcon: .fontAwesomeRegular(.square))

// Stacked icons with smaller background
UIImage.init(bgIcon: .fontAwesomeSolid(.camera), topIcon: .fontAwesomeSolid(.ban), topTextColor: .red, bgLarge: false)

// Stacked icons with custom size
UIImage.init(bgIcon: .fontAwesomeSolid(.camera), topIcon: .fontAwesomeSolid(.ban), topTextColor: .red, bgLarge: false, size: CGSize(width: 50, height: 50))

UIImageView

import SwiftIcons

// Setting icon to image view
imageView.setIcon(icon: .weather(.rainMix))

// Icon with colors
imageView.setIcon(icon: .mapicons(.amusementPark), textColor: .white, backgroundColor: .blue, size: nil)

UILabel

import SwiftIcons

// Setting icon to label
label.setIcon(icon: .ionicons(.paintbrush), iconSize: 70)

// Icon with colors
label.setIcon(icon: .googleMaterialDesign(.rowing), iconSize: 70, color: .white, bgColor: textColor)

// Icon with text around it
label.setIcon(prefixText: "Bus ", icon: .linearIcons(.bus), postfixText: " icon", size: 20)

// Icon with color & colored text around it
label.setIcon(prefixText: "Medal ", prefixTextColor: .red, icon: .ionicons(.ribbonA), iconColor: .red, postfixText: "", postfixTextColor: .red, size: nil, iconSize: 40)

// Icon with text with different fonts around it
label.setIcon(prefixText: "Font ", prefixTextFont: font1!, icon: .fontAwesomeSolid(.font), postfixText: " icon", postfixTextFont: font2!)

// Icon with text with different fonts & colors around it
label.setIcon(prefixText: "Bike ", prefixTextFont: font1!, prefixTextColor: .red, icon: .mapicons(.bicycling), iconColor: textColor, postfixText: " icon", postfixTextFont: font2!, postfixTextColor: .blue, iconSize: 30)

UIButton

import SwiftIcons

// Setting icon to button
button.setIcon(icon: .linearIcons(.phone), forState: .normal)

// Icon with size and color
button.setIcon(icon: .openIconic(.clipboard), iconSize: 70, color: .blue, forState: .normal)

// Icon with text around it
button.setIcon(prefixText: "Please ", icon: .googleMaterialDesign(.print), postfixText: " print", forState: .normal)

// Icon with color & colored text around it
button.setIcon(prefixText: "Lock ", prefixTextColor: .red, icon: .googleMaterialDesign(.lock), iconColor: .yellow, postfixText: " icon", postfixTextColor: .blue, forState: .normal, textSize: 15, iconSize: 20)

// Icon with text with different fonts around it
button.setIcon(prefixText: "Happy ", prefixTextFont: font1!, icon: .ionicons(.happy), postfixText: " face", postfixTextFont: font2!, forState: .normal)

// Icon with text with different fonts & colors around it
button.setIcon(prefixText: "Pulse ", prefixTextFont: font1!, prefixTextColor: .darkGray, icon: .openIconic(.pulse), iconColor: .red, postfixText: " icon", postfixTextFont: font2!, postfixTextColor: .purple, forState: .normal, iconSize: 40)

// Icon with title below icon
button.setIcon(icon: .emoji(.ferrisWheel), title: "Ferris Wheel", color: .red, forState: .normal)

// Icon with title below icon with different color & custom font
button.setIcon(icon: .weather(.rainMix), iconColor: .yellow, title: "RAIN MIX", titleColor: .red, font: font!, backgroundColor: .clear, borderSize: 1, borderColor: .green, forState: .normal)

UISegmentedControl

import SwiftIcons

// Setting icon at particular index
segmentedControl.setIcon(icon: .linearIcons(.thumbsUp), forSegmentAtIndex: 0)
segmentedControl.setIcon(icon: .linearIcons(.thumbsDown), forSegmentAtIndex: 1)

// Icons with sizes & colors
segmentedControl.setIcon(icon: .fontAwesomeSolid(.male), color: .red, iconSize: 50, forSegmentAtIndex: 0)
segmentedControl.setIcon(icon: .fontAwesomeSolid(.female), color: .purple, iconSize: 50, forSegmentAtIndex: 1)

UITabBarItem

import SwiftIcons

// Setting icon to tab bar item
tabBar.items?[0].setIcon(icon: .fontAwesomeSolid(.font), size: nil, textColor: .lightGray)

// Stacked icons for tab bar item
tabBar.items?[1].setIcon(bgIcon: .fontAwesomeRegular(.circle), bgTextColor: .lightGray, topIcon: .fontAwesomeSolid(.square), topTextColor: .lightGray, bgLarge: true, size: nil)

UISlider

import SwiftIcons

// Change minimum & maximum value icons
slider.setMaximumValueIcon(icon: .emoji(.digitNine))
slider.setMinimumValueIcon(icon: .emoji(.digitZero))

// Change minimum & maximum value icons with colors
slider.setMaximumValueIcon(icon: .linearIcons(.pointerUp), customSize: nil, textColor: .red, backgroundColor: .clear)
slider.setMinimumValueIcon(icon: .linearIcons(.pointerDown), customSize: nil, textColor: .blue, backgroundColor: .clear)

UIBarButtonItem

import SwiftIcons

// Setting icon to bar button item
barButtonItem.setIcon(icon: .ionicons(.iosFootball), iconSize: 30)

// Icon with colors
barButtonItem.setIcon(icon: .ionicons(.iosFootball), iconSize: 30, color: textColor)

// Icon with custom cgRect
barButtonItem.setIcon(icon: .ionicons(.iosFootball), iconSize: 30, color: textColor, cgRect: CGRect(x: 0, y: 0, width: 30, height: 30), target: self, action: #selector(barButtonItem(sender:)))

// Icon with text around it
barButtonItem.setIcon(prefixText: "Please ", icon: .ionicons(.iosDownload), postfixText: " download", cgRect: CGRect(x: 0, y: 0, width: 30, height: 30), size: 23, target: self, action: #selector(barButtonItem(sender:)))

// Icon with color & colored text around it
barButtonItem.setIcon(prefixText: "Blue ", prefixTextColor: .red, icon: .ionicons(.iosFootball), iconColor: .blue, postfixText: " football", postfixTextColor: .green, cgRect: CGRect(x: 0, y: 0, width: 30, height: 30), size: 20, iconSize: 30, target: self, action: #selector(barButtonItem(sender:)))

// Icon with text with different fonts around it
barButtonItem.setIcon(prefixText: "Digit ", prefixTextFont: font1!, icon: .emoji(.digitOne), postfixText: " One", postfixTextFont: font2!, cgRect: CGRect(x: 0, y: 0, width: 30, height: 30), target: self, action: #selector(barButtonItem(sender:)))

// Icon with text with different fonts & colors around it
barButtonItem.setIcon(prefixText: "", prefixTextFont: font1!, prefixTextColor: .red, icon: .ionicons(.iosFootball), iconColor: .blue, postfixText: " football", postfixTextFont: font2!, postfixTextColor: .green, cgRect: CGRect(x: 0, y: 0, width: 30, height: 30), iconSize: 24, target: self, action: #selector(barButtonItem(sender:)))

UIViewController

import SwiftIcons

// Setting icon to the title
self.setTitleIcon(icon: .emoji(.animalHorse), iconSize: 30, color: .red)

UITextfield

import SwiftIcons

// Setting left view icon
textfield.setLeftViewIcon(icon: .fontAwesomeSolid(.search))

// Left view icon with colors & leftViewMode
textfield.setLeftViewIcon(icon: .state(.TX), leftViewMode: .always, textColor: .blue, backgroundColor: .clear, size: nil)
textfield.setLeftViewIcon(icon: .googleMaterialDesign(.plusOne), leftViewMode: .unlessEditing, textColor: .green, backgroundColor: .clear, size: nil)

// Setting right view icon
textfield.setRightViewIcon(icon: .openIconic(.questionMark))

// Right view icon with colors & rightViewMode
textfield.setRightViewIcon(icon: .weather(.rainMix), rightViewMode: .always, textColor: .red, backgroundColor: .clear, size: nil)

UIStepper

import SwiftIcons

// Setting icons
stepper.setDecrementIcon(icon: .ionicons(.iosPause), forState: .normal)
stepper.setIncrementIcon(icon: .ionicons(.iosPlay), forState: .normal)

Examples

Please check out the SwiftIcons App. In the demo project, if you click on any object, you will see the method description in the logs for the icon of that object.

SwiftIcons Mentions & Usage

If you are using SwiftIcons in your app and want to be listed here, simply create a new issue here.

I am always curious who is using my projects 😊

Author

Saurabh Rane

Special thanks to Patrik Vaberer and his initial work on Font-Awesome-Swift library

Licence

SwiftIcons is available under the MIT License. See the LICENSE file for more info.

swifticons's People

Contributors

ekurutepe avatar irshadpc avatar madhavajay avatar ranesr avatar sepbehroozi avatar ynnadrules avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swifticons's Issues

How to map the icon name to the library's enum?

For example the IcoFont 5-start-hotel is referenced by .icofont(.fiveStarHotel), is there any direct mapping?

Or is there any way to reference the icon using unicode? such as ef05 to get 5-star-hotel.

screen shot 2017-06-30 at 3 47 36 pm

UIBarButtonItem is not aligned

Hi, I'm using SwiftIcons library (installed though Pod).

I'm trying to create UIBarButtonItem with specific icon.
I set it like this:
menuButton.setIcon(icon: .ionicons(.navicon), iconSize: 35, color: systemColor)
where systemColor == UIView().tintColor
But with this setup, my UIBar looks like this:
image
As, you can see it is not aligned vertically (I tried using SetTitlePositionAdjustment, but I can adjust only horizontal position).

I kinda fixed the position by using:
menuButton.setIcon(prefixText: "", icon: .ionicons(.navicon), iconColor: systemColor, postfixText: "", cgRect: CGRect(x: 30, y: 30, width: 30, height: 30), size: 35, iconSize: 36)
image

But, then button is not tappable...

Can anyone help me here?

ionicons rewind misspelt

In ionicons.com there are ion-ios-rewind and ion-ios-rewind-outline icons yet in SwifIcons they are spelled as iosReward and iosRewardOutline accordingly. They should be renamed.

UIColor extension ambiguous when using Hue

Popular UIColor library Hue uses the UIColor(hex:) constructor in an extension, leading to a conflict with the convenience init in the UIColor extension.

public extension UIColor { convenience init(hex: String) {

Raising the error:

Ambiguous use of init(hex:)
Please remove or consider making Hue a dependency or using a non-conflicting category convenience method?

UIButton iconColor is ignored when title is present

I am using the following code alter the color of the text as well as the icon:

trendingTabButton.setIcon(icon: .emoji(.fire), iconColor: .red, title: "Title", titleColor: .yellow, backgroundColor: UIColor.clear, borderSize: 0, borderColor: UIColor.clear, forState: .normal)

But when I run this the title is red yet the icon is the default blue still

Bold font not staying

I have a UILabel which sometimes has an icon and sometimes not. By default the label is set with a bold font in the Storyboard and at the launch it does not contains any icon (the text is simply set with label.text).

If I apply the icon and the text with .setIcon(), the first time the bold attribute will stay but if I run .setIcon() a second time to update the text content, the font will be overwritten with the standard one, being not bold.

The only workaround I found is to store in a variable during viewDidLoad() the original bold font and before each execution of .setIcon() I re-set the original font with label.font = initialLabelFont.

Why icon position on top for UILabel with postfix text.?

I added a label with icon and postfix text.
The icon is set to top position.
Please find my code

label.setIcon(prefixText: "", prefixTextColor: .clear, icon: .appsFont(.keyboard_arrow_down), iconColor:.blue, postfixText: text, postfixTextColor: .blue, size: 18, iconSize: 18)

screen shot 2018-08-31 at 10 47 59 am

I need that arrow center alignment to text.

Please suggest how to overcome this issue.

Thanks in advance.

UIBarButtonItem shows questionmark placeholder while the button action gets performed in iOS 11

I have multiple UIBarButtonItems like this:
let plusButton = UIBarButtonItem(title: "Plus", style: .plain, target: self, action: #selector(showMore))
plusButton.setIcon(icon: .ionicons(.iosPlusOutline), iconSize: 25.0, color: Colors.drakGreen)
Till iOS 10 everthing worked fine. But under iOS 11 I get a questionmark placeholder when I press one of the buttons. This placeholder stays there until the action the button triggers is completed:
2017-09-27 13 12 04

Update Podspec

The last merged PR (#57) did not update the podspec file. Please, do so.

Why is text centered when setting icon to UILabel?

Why does the function UILabel.setIcon(...) change the alignment of the text on the label to .center? The documentation on these functions do not specify that the alignment is changed. I found this to be unexpected behavior and I don't want to the alignment on my label to be changed when using this function.

Found in SwiftIcons.swift in the following functions:

setIcon(prefixText: String, prefixTextColor: UIColor = .black, icon: FontType?, iconColor: UIColor = .black, postfixText: String, postfixTextColor: UIColor = .black, size: CGFloat?, iconSize: CGFloat? = nil) {
    // ...
    textAlignment = .center
}

setIcon(prefixText: String, prefixTextFont: UIFont, prefixTextColor: UIColor = .black, icon: FontType?, iconColor: UIColor = .black, postfixText: String, postfixTextFont: UIFont, postfixTextColor: UIColor = .black, iconSize: CGFloat? = nil) {
    // ...
    textAlignment = .center
}

Is there a reason why the alignment is changed? If not I would suggest removing the line.

Any planned support for adding custom fonts?

I tend to have some vector icons I load up in custom font file. I wish there was support or I end up forking it and manually having to add it in. It would be nice if it was more dynamic as to be able to load font files of your choosing without including all of them.

How does this project work?

Hello,

Are all of these icons stored in the library? If so, how is the library so small?

Do only used icons from the library ship with the app bundle?

Thanks,
-Sami

Rounded Corner

Is there a way of making an icon have a corner radius when a background colour is present?

setting barbuttonItems cuts off icon

When I set a navigation bar like below, the icon gets cut off.

let settingsBarButton = UIBarButtonItem()
settingsBarButton.setIcon(icon: .emoji(.gear), iconSize: 30)
navigationItem.rightBarButtonItems = [settingsBarButton]

image

Not sure what's wrong since the example in your readme also uses size 30.

edit:
setting it via

settingsBarButton.image = UIImage(icon: .emoji(.gear), size: CGSize(width: 30, height: 30))

works fine

Move icons to different pods

While compiling my project copying icons take too much time especially Dripicons.ttf which I don't use. I only use FontAwesomeSolid.ttf. Is it possible to move icons to different pods so we can opt out like:

pod 'SwiftIcons', '~> 2.3.2'
pod 'SwiftIcons/FontAwesomeSolid'

Using setIcon with no icon (at the moment attempt to set icon to nil results in crash)

It might sound counterintuitive, but I wanted to use setIcon() to set a normal button title, with no icon at all.

Why I was trying to do this? I have a button, which changes its state - one of the states has icon and another doesn't have it. I simply wanted to have cleaner code like this:

    enum ButtonState {
        case gift, cancel
    }
    
    private func updateButton(state: ButtonState) {
        self.buyGiftButton.setIcon(prefixText: "", prefixTextFont: myFont,
            icon: state == .gift ? .fontAwesome(.gift) : nil,
            postfixText: state == .gift ? " Buy as a gift" : "Cancel", postfixTextFont: myFont, postfixTextColor: .white,
            backgroundColor: myColor, forState: .normal, iconSize: 20)
    }

But it looks like the icon is force-unwrapped in there and this is not possible. Instead I had to make if-else and do .setAttributedTitle for that button.

It would be good if icon was really handled as an optional in setIcon (feature request).

Is there a way can use String to set Icon?

normally use enum to tell func what icon u want ?
cell.imgvIcon.setIcon(icon: .fontAwesome(.addressBook))

but if the icon type is from server, can i use string to set icon ?
cell.imgvIcon.setIcon(iconString: "fontAwesome.addressBook")

i found .text can get name of this icon.
Can i use this name as parameter?

Icons showing as "?"

I have noticed the icons sometimes are rendered as question marks. This happens when you return to a view in the navigation stack or when a viewcontroller is presented in a modal.

Im using version 2.0.1 which should have a fix to a similar issue.
I have tested on an iPhone 8 plus with the latest iOS and on the Simulators and the issue is the same.

UIButton, UISegmentControl and UILabels all present the same issue.
screen shot 2018-04-05 at 23 19 38
image

Different constants not resizing for iPad

I am assigning a button icon to different screen sizes. It only works on the iPhone settings and not the iPad.

storyboard constant settings.

Screen Shot 2019-05-06 at 10 43 47 AM

iPad results - the icon does not resize. It also does not center to the new size. The text does center.

Screen Shot 2019-05-06 at 10 42 59 AM

iphone settings are fine.

Screen Shot 2019-05-06 at 10 39 26 AM

Using Swift 4.2 and Xcode 10.2.1

Does not work with swift 3

many of the methods has been renamed

  1. NSParagraphStyleAttributeName' has been renamed to 'NSAttributedStringKey.paragraphStyle'
    Well there are total 33 methods which has been renamed and hence shows issues for swift 3

Swift 4 support?

Can we get swift 4 supp? Now there are a lot of compile errors

Terminal Warnings for UIButton

On iOS9 and up, these terminal warnings are shown:

[Assert] button text attributes only respected for UIControlStateNormal, UIControlStateHighlighted, UIControlStateDisabled and UIControlStateFocused. state = 4 is interpreted as UIControlStateHighlighted.

Building SwiftIcons on Xcode 10.2.1 takes forever

I've update the Xcode into 10.2.1 after I've cleaned the project and build again. Xcode struck on building SwiftIcons like there's no ending to it. There is no error appears so far.

Xcode Version 10.2.1 (10E1001)
SwiftIcons version 2.3.2
Swift Language Version 4.2

CocoaPods could not find compatible versions for pod "SwiftIcons": on Xcode 10

Try to install via cocoapods but I have faced compatible issues. I have using Xcode 10.

[!] CocoaPods could not find compatible versions for pod "SwiftIcons":
In Podfile:
SwiftIcons (~> 2.2.0)

None of your spec sources contain a spec satisfying the dependency: SwiftIcons (~> 2.2.0).

You have either:

  • out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
  • mistyped the name or version.
  • not added the source repo that hosts the Podspec to your Podfile.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.