Use Any Font - Version 4.2

Version Description

  • Compatible with 3.9
  • Fixed font list issue in editor for 3.9
Download this release

Release Info

Developer dnesscarkey
Plugin Icon 128x128 Use Any Font
Version 4.2
Comparing to
See all releases

Code changes from version 4.0 to 4.2

css/uaf.css ADDED
File without changes
includes/uaf_editor_setup.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
  function uaf_mce_before_init( $init_array ) {
3
-
4
  $theme_advanced_fonts = '';
5
  $fontsRawData = get_option('uaf_font_data');
6
  $fontsData = json_decode($fontsRawData, true);
@@ -10,30 +9,11 @@ function uaf_mce_before_init( $init_array ) {
10
  endforeach;
11
  endif;
12
 
13
- $theme_advanced_fonts .= 'Andale Mono=Andale Mono, Times;';
14
- $theme_advanced_fonts .= 'Arial=Arial, Helvetica, sans-serif;';
15
- $theme_advanced_fonts .= 'Arial Black=Arial Black, Avant Garde;';
16
- $theme_advanced_fonts .= 'Book Antiqua=Book Antiqua, Palatino;';
17
- $theme_advanced_fonts .= 'Comic Sans MS=Comic Sans MS, sans-serif;';
18
- $theme_advanced_fonts .= 'Courier New=Courier New, Courier;';
19
- $theme_advanced_fonts .= 'Georgia=Georgia, Palatino;';
20
- $theme_advanced_fonts .= 'Helvetica=Helvetica;';
21
- $theme_advanced_fonts .= 'Impact=Impact, Chicago;';
22
- $theme_advanced_fonts .= 'Symbol=Symbol;';
23
- $theme_advanced_fonts .= 'Tahoma=Tahoma, Arial, Helvetica, sans-serif;';
24
- $theme_advanced_fonts .= 'Terminal=Terminal, Monaco;';
25
- $theme_advanced_fonts .= 'Times New Roman=Times New Roman, Times;';
26
- $theme_advanced_fonts .= 'Trebuchet MS=Trebuchet MS, Geneva;';
27
- $theme_advanced_fonts .= 'Verdana=Verdana, Geneva;';
28
- $theme_advanced_fonts .= 'Webdings=Webdings;';
29
- $theme_advanced_fonts .= 'Wingdings=Wingdings, Zapf Dingbats;';
30
-
31
- $init_array['theme_advanced_fonts'] = $theme_advanced_fonts;
32
  return $init_array;
33
  }
34
 
35
  function wp_editor_fontsize_filter( $options ) {
36
- array_shift( $options );
37
  array_unshift( $options, 'fontsizeselect');
38
  array_unshift( $options, 'fontselect');
39
  return $options;
1
  <?php
2
  function uaf_mce_before_init( $init_array ) {
 
3
  $theme_advanced_fonts = '';
4
  $fontsRawData = get_option('uaf_font_data');
5
  $fontsData = json_decode($fontsRawData, true);
9
  endforeach;
10
  endif;
11
 
12
+ $init_array['font_formats'] = $theme_advanced_fonts.'Andale Mono=Andale Mono, Times;Arial=Arial, Helvetica, sans-serif;Arial Black=Arial Black, Avant Garde;Book Antiqua=Book Antiqua, Palatino;Comic Sans MS=Comic Sans MS, sans-serif;Courier New=Courier New, Courier;Georgia=Georgia, Palatino;Helvetica=Helvetica;Impact=Impact, Chicago;Symbol=Symbol;Tahoma=Tahoma, Arial, Helvetica, sans-serif;Terminal=Terminal, Monaco;Times New Roman=Times New Roman, Times;Trebuchet MS=Trebuchet MS, Geneva;Verdana=Verdana, Geneva;Webdings=Webdings;Wingdings=Wingdings';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  return $init_array;
14
  }
15
 
16
  function wp_editor_fontsize_filter( $options ) {
 
17
  array_unshift( $options, 'fontsizeselect');
18
  array_unshift( $options, 'fontselect');
19
  return $options;
includes/uaf_font_upload.php CHANGED
@@ -139,7 +139,7 @@ $fontsData = json_decode($fontsRawData, true);
139
  <tr>
140
  <td>Font File</td>
141
  <td><input type="file" name="font_file" value="" class="required" /><br/>
142
- <em>Accepted Font Format : ttf, otf, eot, woff, svg</em>
143
  </td>
144
  </tr>
145
  <tr>
@@ -192,10 +192,10 @@ $fontsData = json_decode($fontsRawData, true);
192
  jQuery("#open_add_font_form").validate({
193
  rules: {
194
  font_name : {required:true, maxlength:40},
195
- font_file : {required:true, accept:'ttf|otf|eot|woff|svg'}
196
  },
197
  messages:{
198
- font_file : {accept:'Only ttf,otf,eot,woff,svg font format accepted now.'}
199
  }
200
  });
201
  }
139
  <tr>
140
  <td>Font File</td>
141
  <td><input type="file" name="font_file" value="" class="required" /><br/>
142
+ <em>Accepted Font Format : ttf, otf, eot, woff, svg, dfont, suit | Font Size: Less than 2MB</em>
143
  </td>
144
  </tr>
145
  <tr>
192
  jQuery("#open_add_font_form").validate({
193
  rules: {
194
  font_name : {required:true, maxlength:40},
195
+ font_file : {required:true, accept:'ttf|otf|eot|woff|svg|dfont|suit'}
196
  },
197
  messages:{
198
+ font_file : {accept:'ttf,otf,eot,woff,svg,dfont,suit font format accepted now.'}
199
  }
200
  });
201
  }
includes/uaf_footer.php CHANGED
@@ -40,7 +40,48 @@ if (isset($_POST['test_server']) || empty($server_status)){
40
  }
41
  $server_status = get_option('uaf_server_status');
42
  $server_message = get_option('uaf_server_msg');
 
 
 
 
 
 
 
 
 
 
 
 
43
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  <br/>
45
  <table class="wp-list-table widefat fixed bookmarks">
46
  <thead>
@@ -64,7 +105,7 @@ $server_message = get_option('uaf_server_msg');
64
 
65
  <li>You can also assign uploaded font directly from Post/Page Wordpress Editor.</li>
66
 
67
- <li>You are are fond of visual instructions, you can check it <a href="http://dineshkarki.com.np/use-any-font/instructions" target="_blank">here</a>.</li>
68
 
69
  <li>You are ready now. If you still have any problem visit our <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts" target="_blank">support forum</a> or you can write to us directly using our contact form.</li>
70
 
40
  }
41
  $server_status = get_option('uaf_server_status');
42
  $server_message = get_option('uaf_server_msg');
43
+
44
+ // SETTINGS
45
+ if (isset($_POST['submit-uaf-settings'])){
46
+ if (isset($_POST['uaf_disbale_editor_font_list'])){
47
+ $uaf_disbale_editor_font_list = 1;
48
+ } else {
49
+ $uaf_disbale_editor_font_list = '';
50
+ }
51
+ update_option('uaf_disbale_editor_font_list', $uaf_disbale_editor_font_list);
52
+ $settings_message = 'Settings Saved';
53
+ }
54
+ $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
55
  ?>
56
+
57
+ <?php if (!empty($settings_message)):?>
58
+ <div class="updated" id="message"><p><?php echo $settings_message ?></p></div>
59
+ <?php endif; ?>
60
+
61
+
62
+ <br/>
63
+ <table class="wp-list-table widefat fixed bookmarks">
64
+ <thead>
65
+ <tr>
66
+ <th>Additional Settings (Usually not required)</th>
67
+ </tr>
68
+ </thead>
69
+ <tbody>
70
+ <form method="post" action="">
71
+ <tr>
72
+ <td>
73
+ <input type="checkbox" name="uaf_disbale_editor_font_list" value="1" <?php echo $uaf_disbale_editor_font_list_value == 1?'checked=checked':''; ?> /> Disable Font list in wordpress editor.
74
+ </td>
75
+ </tr>
76
+
77
+ <tr>
78
+ <td><input type="submit" name="submit-uaf-settings" class="button-primary" value="Save Settings" /></td>
79
+ </tr>
80
+ </form>
81
+
82
+ </tbody>
83
+ </table>
84
+
85
  <br/>
86
  <table class="wp-list-table widefat fixed bookmarks">
87
  <thead>
105
 
106
  <li>You can also assign uploaded font directly from Post/Page Wordpress Editor.</li>
107
 
108
+ <li>If you are fond of visual instructions, you can check it <a href="http://dineshkarki.com.np/use-any-font/instructions" target="_blank">here</a>.</li>
109
 
110
  <li>You are ready now. If you still have any problem visit our <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts" target="_blank">support forum</a> or you can write to us directly using our contact form.</li>
111
 
plugin_interface.php CHANGED
@@ -4,8 +4,12 @@ add_action("admin_print_scripts", 'adminjslibs');
4
  add_action("admin_print_styles", 'adminCsslibs');
5
  add_action('wp_enqueue_scripts', 'uaf_client_css');
6
  add_action('plugins_loaded', 'uaf_update_check');
7
- add_filter('mce_buttons_2', 'wp_editor_fontsize_filter');
8
- add_filter( 'tiny_mce_before_init', 'uaf_mce_before_init' );
 
 
 
 
9
 
10
  function uaf_client_css() {
11
  $uaf_upload = wp_upload_dir();
@@ -51,8 +55,8 @@ function uaf_activate(){
51
 
52
  function uaf_update_check() { // MUST CHANGE WITH EVERY VERSION
53
  $uaf_version_check = get_option('uaf_current_version');
54
- if ($uaf_version_check != 4.0):
55
- update_option('uaf_current_version', '4.0');
56
  if ($uaf_version_check < 4.0):
57
  uaf_create_folder();
58
  uaf_move_file_to_newPath();
@@ -115,7 +119,9 @@ function uaf_write_css(){
115
  $uaf_upload_dir = $uaf_upload['basedir'];
116
  $uaf_upload_dir = $uaf_upload_dir . '/useanyfont/';
117
  $uaf_upload_url = $uaf_upload['baseurl'];
118
- $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
 
 
119
  ob_start();
120
  $fontsRawData = get_option('uaf_font_data');
121
  $fontsData = json_decode($fontsRawData, true);
@@ -124,8 +130,8 @@ function uaf_write_css(){
124
  @font-face {
125
  font-family: '<?php echo $fontData['font_name'] ?>';
126
  font-style: normal;
127
- src: url(<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot);
128
- src: local('<?php echo $fontData['font_name'] ?>'), url(<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot) format('embedded-opentype'), url(<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff) format('woff');
129
  }
130
  <?php
131
  endforeach;
@@ -156,8 +162,8 @@ function uaf_write_css(){
156
  @font-face {
157
  font-family: '<?php echo $fontData['font_name'] ?>';
158
  font-style: normal;
159
- src: url(<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot);
160
- src: local('<?php echo $fontData['font_name'] ?>'), url(<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot) format('embedded-opentype'), url(<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff) format('woff');
161
  }
162
  <?php
163
  endforeach;
4
  add_action("admin_print_styles", 'adminCsslibs');
5
  add_action('wp_enqueue_scripts', 'uaf_client_css');
6
  add_action('plugins_loaded', 'uaf_update_check');
7
+
8
+ $uaf_disbale_editor_font_list_value = get_option('uaf_disbale_editor_font_list');
9
+ if ($uaf_disbale_editor_font_list_value != 1):
10
+ add_filter('mce_buttons_2', 'wp_editor_fontsize_filter');
11
+ add_filter('tiny_mce_before_init', 'uaf_mce_before_init' );
12
+ endif;
13
 
14
  function uaf_client_css() {
15
  $uaf_upload = wp_upload_dir();
55
 
56
  function uaf_update_check() { // MUST CHANGE WITH EVERY VERSION
57
  $uaf_version_check = get_option('uaf_current_version');
58
+ if ($uaf_version_check != 4.2):
59
+ update_option('uaf_current_version', '4.2');
60
  if ($uaf_version_check < 4.0):
61
  uaf_create_folder();
62
  uaf_move_file_to_newPath();
119
  $uaf_upload_dir = $uaf_upload['basedir'];
120
  $uaf_upload_dir = $uaf_upload_dir . '/useanyfont/';
121
  $uaf_upload_url = $uaf_upload['baseurl'];
122
+ $uaf_upload_url = $uaf_upload_url . '/useanyfont/';
123
+ $uaf_upload_url = preg_replace('#^https?:#', '', $uaf_upload_url);
124
+
125
  ob_start();
126
  $fontsRawData = get_option('uaf_font_data');
127
  $fontsData = json_decode($fontsRawData, true);
130
  @font-face {
131
  font-family: '<?php echo $fontData['font_name'] ?>';
132
  font-style: normal;
133
+ src: url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot');
134
+ src: local('<?php echo $fontData['font_name'] ?>'), url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot') format('embedded-opentype'), url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
135
  }
136
  <?php
137
  endforeach;
162
  @font-face {
163
  font-family: '<?php echo $fontData['font_name'] ?>';
164
  font-style: normal;
165
+ src: url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot');
166
+ src: local('<?php echo $fontData['font_name'] ?>'), url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.eot') format('embedded-opentype'), url('<?php echo $uaf_upload_url.$fontData['font_path'] ?>.woff') format('woff');
167
  }
168
  <?php
169
  endforeach;
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: dnesscarkey
3
  Tags: use any font, any font, embed any font, font embed, font uploader, css3 font embed, @font-face embed, font conversion, webfont, ttf, opentype, custom fonts
4
  Requires at least: 3.0
5
- Tested up to: 3.6
6
- Stable tag: 4.0
7
 
8
  Embed any font in your website
9
 
@@ -12,7 +12,7 @@ Use any font you wish and give your site a elegant look. No css knowledge requir
12
 
13
  Click <a href="http://dineshkarki.com.np/use-any-font/demo" target="_blank">here</a> for Use Any Font working demo.
14
 
15
- Use Any Font gives you freedom to use any font in your website. It is not like other font embed services which gives you countable number of fonts to select from neither the one that stores your font in remote server. You can use any font if you have its font format (ttf,otf,eot,woff,svg) without being dependent to other's server uptime.
16
 
17
  Features
18
 
@@ -20,7 +20,7 @@ Features
20
  * Support all major browsers including IE 6+, Firefox, Chrome, Safari, IOS, Andriod, Opera and more.
21
  * Font conversion within the plugin interface font uploader.
22
  * Use uploaded font directly from Editor
23
- * Supports font format including ttf, otf, eot, woff, svg (Upgrading more). The required font are converted automatically.
24
  * Embed fonts using @font-face css. SEO friendly and quick loading.
25
  * Multiple fonts can be used.
26
  * Faster load time as your custom fonts are stored on your own server.
@@ -30,7 +30,7 @@ Features
30
 
31
  You need API key to connect to our server for font conversion. Our server converts your font and sends it back.
32
 
33
- Offer your contribution (Free to $100) and get the API key from <a href="http://dnesscarkey.com/font-convertor/api/" target="_blank">here</a>.
34
 
35
  Note : We don't store your fonts in our server neither any of your information except the API key details. Our server deletes the temporary file after the conversion is done.
36
 
@@ -46,9 +46,18 @@ We don't respond to support tickets created here. Please visit our <a href="http
46
  1. Assign your font to element.
47
  1. You can also assign the font directly from wordpress page/post editor.
48
  1. Your fonts are working in your site now.
 
49
 
50
  == Frequently Asked Questions ==
51
 
 
 
 
 
 
 
 
 
52
  = Does it works with multiple fonts ? =
53
 
54
  Ya, it works with multiple fonts. For multiple font conversion request, you need to get the Premium Key.
@@ -57,6 +66,14 @@ Ya, it works with multiple fonts. For multiple font conversion request, you need
57
 
58
  No, you don't need to do it yourself. Just upload your font(supports most of the font format), and the plugin does the rest.
59
 
 
 
 
 
 
 
 
 
60
  = I moved my server path and the font is not working now. Why ? =
61
 
62
  The plugin is still searching font from your old path. You can delete your old uploaded font and re-upload and re-assign it.
@@ -68,13 +85,30 @@ You can check our <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts"
68
 
69
  == Screenshots ==
70
 
71
- 1. Use Any Font Demo
72
- 1. Use Any Font Plugin Setup
73
- 1. Assign font directly from Wordpress Editor
 
 
74
 
75
  == Changelog ==
76
 
77
- = 4. =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  * Added Network Site Support
79
  * Assign font directly from Wordpress Editor
80
 
@@ -86,7 +120,7 @@ You can check our <a href="http://dineshkarki.com.np/forums/forum/use-any-fonts"
86
  * Add woff and svg font format
87
 
88
  = 3.0 =
89
- *Major update
90
  * Supports more font format now.
91
  * Better error handling
92
  * Added hyperlink (a tag) in default element select.
2
  Contributors: dnesscarkey
3
  Tags: use any font, any font, embed any font, font embed, font uploader, css3 font embed, @font-face embed, font conversion, webfont, ttf, opentype, custom fonts
4
  Requires at least: 3.0
5
+ Tested up to: 3.9
6
+ Stable tag: 4.2
7
 
8
  Embed any font in your website
9
 
12
 
13
  Click <a href="http://dineshkarki.com.np/use-any-font/demo" target="_blank">here</a> for Use Any Font working demo.
14
 
15
+ Use Any Font gives you freedom to use any font in your website. It is not like other font embed services which gives you countable number of fonts to select from neither the one that stores your font in remote server. You can use any font if you have its font format (ttf,otf,eot,woff,svg,dfont,suit) without being dependent to other's server uptime.
16
 
17
  Features
18
 
20
  * Support all major browsers including IE 6+, Firefox, Chrome, Safari, IOS, Andriod, Opera and more.
21
  * Font conversion within the plugin interface font uploader.
22
  * Use uploaded font directly from Editor
23
+ * Supports font format including ttf, otf, eot, woff, svg, dfont, suit (Will continue adding more). The required fonts are converted automatically.
24
  * Embed fonts using @font-face css. SEO friendly and quick loading.
25
  * Multiple fonts can be used.
26
  * Faster load time as your custom fonts are stored on your own server.
30
 
31
  You need API key to connect to our server for font conversion. Our server converts your font and sends it back.
32
 
33
+ Offer your contribution (Free, $10 to $100) and get the API key from <a href="http://dnesscarkey.com/font-convertor/api/" target="_blank">here</a>.
34
 
35
  Note : We don't store your fonts in our server neither any of your information except the API key details. Our server deletes the temporary file after the conversion is done.
36
 
46
  1. Assign your font to element.
47
  1. You can also assign the font directly from wordpress page/post editor.
48
  1. Your fonts are working in your site now.
49
+ 1. You may refer to Screenshots tab for visual instructions.
50
 
51
  == Frequently Asked Questions ==
52
 
53
+ = Which font format does plugin accepts ? =
54
+
55
+ Currently, ttf, otf, eot, woff, svg, dfont, suit font format are accepted.
56
+
57
+ = What is the max font file size ? =
58
+
59
+ Font file upto 2MB is acceptable. However, we suggest you to use smaller ones as far as possible. The font file size directly affects your site load time.
60
+
61
  = Does it works with multiple fonts ? =
62
 
63
  Ya, it works with multiple fonts. For multiple font conversion request, you need to get the Premium Key.
66
 
67
  No, you don't need to do it yourself. Just upload your font(supports most of the font format), and the plugin does the rest.
68
 
69
+ = Font uploaded from Use Any Font is not showing in wordpress editor ? =
70
+
71
+ Please check screenshot #4 in Screenshots tab.
72
+
73
+ = I want to disable font list from wordpress editor ? =
74
+
75
+ Please check screenshot #5 in Screenshots tab.
76
+
77
  = I moved my server path and the font is not working now. Why ? =
78
 
79
  The plugin is still searching font from your old path. You can delete your old uploaded font and re-upload and re-assign it.
85
 
86
  == Screenshots ==
87
 
88
+ 1. Screenshot #1. Use Any Font Demo
89
+ 1. Screenshot #2. Use Any Font Plugin Setup
90
+ 1. Screenshot #3. Assign font directly from Wordpress Editor
91
+ 1. Screenshot #4. Font list not showing in editor.
92
+ 1. Screenshot #5. Disable font list in editor.
93
 
94
  == Changelog ==
95
 
96
+ = 4.2 =
97
+ * Compatible with 3.9
98
+ * Fixed font list issue in editor for 3.9
99
+
100
+ = 4.1.1 =
101
+ * Minor update
102
+ * Added font formats (dfont, suit)
103
+ * Updated FAQ and Screenshots.
104
+ * Tested with 3.8.1
105
+
106
+ = 4.1 =
107
+ * Added Support for SSL (https)
108
+ * Additional settings to disbale font list in wordpress editor.
109
+ * Tested with 3.8
110
+
111
+ = 4.0 =
112
  * Added Network Site Support
113
  * Assign font directly from Wordpress Editor
114
 
120
  * Add woff and svg font format
121
 
122
  = 3.0 =
123
+ * Major update
124
  * Supports more font format now.
125
  * Better error handling
126
  * Added hyperlink (a tag) in default element select.
screenshot-2.png CHANGED
Binary file
screenshot-4.png ADDED
Binary file
screenshot-5.png ADDED
Binary file
use-any-font.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Use Any Font
4
  Plugin URI: http://dineshkarki.com.np/use-any-font
5
  Description: Embed any font in your website
6
  Author: Dinesh Karki
7
- Version: 4.0
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10
 
4
  Plugin URI: http://dineshkarki.com.np/use-any-font
5
  Description: Embed any font in your website
6
  Author: Dinesh Karki
7
+ Version: 4.2
8
  Author URI: http://www.dineshkarki.com.np
9
  */
10