Last active
January 2, 2016 07:29
-
-
Save quinn/8270709 to your computer and use it in GitHub Desktop.
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
<link rel="import" href="../components/polymer/polymer.html"> | |
<polymer-element name="font-family" attributes="family normal italic bold italic-bold format url" lightdom> | |
<template> | |
<template if="{{normal}}"> | |
<style> | |
@font-face { | |
font-family: '{{family}}'; | |
src: {{url}}('{{normal}}') format('{{format}}'); | |
font-weight: normal; | |
font-style: normal; | |
} | |
</style> | |
</template> | |
<template if="{{italic}}"> | |
<style> | |
@font-face { | |
font-family: '{{family}}'; | |
src: {{url}}('{{italic}}') format('{{format}}'); | |
font-weight: normal; | |
font-style: italic; | |
} | |
</style> | |
</template> | |
<template if="{{bold}}"> | |
<style> | |
@font-face { | |
font-family: '{{family}}'; | |
src: {{url}}('{{bold}}') format('{{format}}'); | |
font-weight: bold; | |
font-style: normal; | |
} | |
</style> | |
</template> | |
<template if="{{italic-bold}}"> | |
<style> | |
@font-face { | |
font-family: '{{family}}'; | |
src: {{url}}('{{italic-bold}}') format('{{format}}'); | |
font-weight: bold; | |
font-style: italic; | |
} | |
</style> | |
</template> | |
</template> | |
<script> | |
Polymer('font-family', { | |
format: 'opentype', | |
url: 'url' | |
}); | |
</script> | |
</polymer-element> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="../components/platform/platform.js"></script> | |
<link rel="import" href="../elements/font-family.html"> | |
<script src="app://timeline/js/index.js"></script> | |
<font-family family="Droid Serif" | |
normal="DroidSerif-Regular-webfont.ttf" | |
italic="DroidSerif-Italic-webfont.ttf" | |
bold="DroidSerif-BoldItalic-webfont.ttf" | |
format="truetype"></font-family> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment