summaryrefslogtreecommitdiff
path: root/src/pshinter/pshoptim.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pshinter/pshoptim.c')
-rw-r--r--src/pshinter/pshoptim.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/pshinter/pshoptim.c b/src/pshinter/pshoptim.c
new file mode 100644
index 000000000..ea8dd6037
--- /dev/null
+++ b/src/pshinter/pshoptim.c
@@ -0,0 +1,30 @@
+#include "pshoptim.h"
+
+ FT_LOCAL_DEF FT_Error
+ psh_hint_table_optimize( PSH_Hint_Table table,
+ PSH_Globals globals,
+ FT_Outline* outline,
+ FT_Bool vertical )
+ {
+ PSH_Dimension dim = &globals->dimension[vertical];
+ FT_Fixed scale = dim->scale_mult;
+ FT_Fixed delta = dim->scale_delta;
+
+ /* XXXX: for now, we only scale the hints to test all other aspects */
+ /* of the Postscript Hinter.. */
+ {
+ PSH_Hint hint;
+ FT_UInt count;
+
+ for ( count = 0; count < table->num_hints; count++ )
+ {
+ hint = table->sort[count];
+ if ( psh_hint_is_active(hint) )
+ {
+ hint->cur_pos = FT_MulFix( hint->org_pos, scale ) + delta;
+ hint->cur_len = FT_MulFix( hint->org_len, scale );
+ }
+ }
+ }
+ return 0;
+ }