ReactOS 0.4.16-dev-1019-g2c2cdfd
pshglob.c File Reference
#include <ft2build.h>
#include "pshglob.h"
Include dependency graph for pshglob.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static void psh_globals_scale_widths (PSH_Globals globals, FT_UInt direction)
 
static void psh_blues_set_zones_0 (PSH_Blues target, FT_Bool is_others, FT_UInt read_count, FT_Short *read, PSH_Blue_Table top_table, PSH_Blue_Table bot_table)
 
static void psh_blues_set_zones (PSH_Blues target, FT_UInt count, FT_Short *blues, FT_UInt count_others, FT_Short *other_blues, FT_Int fuzz, FT_Int family)
 
static void psh_blues_scale_zones (PSH_Blues blues, FT_Fixed scale, FT_Pos delta)
 
static FT_Short psh_calc_max_height (FT_UInt num, const FT_Short *values, FT_Short cur_max)
 
 psh_blues_snap_stem (PSH_Blues blues, FT_Int stem_top, FT_Int stem_bot, PSH_Alignment alignment)
 
static void psh_globals_destroy (PSH_Globals globals)
 
static FT_Error psh_globals_new (FT_Memory memory, T1_Private *priv, PSH_Globals *aglobals)
 
 psh_globals_set_scale (PSH_Globals globals, FT_Fixed x_scale, FT_Fixed y_scale, FT_Fixed x_delta, FT_Fixed y_delta)
 
 psh_globals_funcs_init (PSH_Globals_FuncsRec *funcs)
 

Function Documentation

◆ psh_blues_scale_zones()

static void psh_blues_scale_zones ( PSH_Blues  blues,
FT_Fixed  scale,
FT_Pos  delta 
)
static

Definition at line 367 of file pshglob.c.

370 {
372 FT_UInt num;
374
375 /* */
376 /* Determine whether we need to suppress overshoots or */
377 /* not. We simply need to compare the vertical scale */
378 /* parameter to the raw bluescale value. Here is why: */
379 /* */
380 /* We need to suppress overshoots for all pointsizes. */
381 /* At 300dpi that satisfies: */
382 /* */
383 /* pointsize < 240*bluescale + 0.49 */
384 /* */
385 /* This corresponds to: */
386 /* */
387 /* pixelsize < 1000*bluescale + 49/24 */
388 /* */
389 /* scale*EM_Size < 1000*bluescale + 49/24 */
390 /* */
391 /* However, for normal Type 1 fonts, EM_Size is 1000! */
392 /* We thus only check: */
393 /* */
394 /* scale < bluescale + 49/24000 */
395 /* */
396 /* which we shorten to */
397 /* */
398 /* "scale < bluescale" */
399 /* */
400 /* Note that `blue_scale' is stored 1000 times its real */
401 /* value, and that `scale' converts from font units to */
402 /* fractional pixels. */
403 /* */
404
405 /* 1000 / 64 = 125 / 8 */
406 if ( scale >= 0x20C49BAL )
407 blues->no_overshoots = FT_BOOL( scale < blues->blue_scale * 8 / 125 );
408 else
409 blues->no_overshoots = FT_BOOL( scale * 125 < blues->blue_scale * 8 );
410
411 /* */
412 /* The blue threshold is the font units distance under */
413 /* which overshoots are suppressed due to the BlueShift */
414 /* even if the scale is greater than BlueScale. */
415 /* */
416 /* It is the smallest distance such that */
417 /* */
418 /* dist <= BlueShift && dist*scale <= 0.5 pixels */
419 /* */
420 {
421 FT_Int threshold = blues->blue_shift;
422
423
424 while ( threshold > 0 && FT_MulFix( threshold, scale ) > 32 )
425 threshold--;
426
427 blues->blue_threshold = threshold;
428 }
429
430 for ( num = 0; num < 4; num++ )
431 {
433
434
435 switch ( num )
436 {
437 case 0:
438 table = &blues->normal_top;
439 break;
440 case 1:
441 table = &blues->normal_bottom;
442 break;
443 case 2:
444 table = &blues->family_top;
445 break;
446 default:
447 table = &blues->family_bottom;
448 break;
449 }
450
451 zone = table->zones;
452 count = table->count;
453 for ( ; count > 0; count--, zone++ )
454 {
455 zone->cur_top = FT_MulFix( zone->org_top, scale ) + delta;
456 zone->cur_bottom = FT_MulFix( zone->org_bottom, scale ) + delta;
457 zone->cur_ref = FT_MulFix( zone->org_ref, scale ) + delta;
458 zone->cur_delta = FT_MulFix( zone->org_delta, scale );
459
460 /* round scaled reference position */
461 zone->cur_ref = FT_PIX_ROUND( zone->cur_ref );
462
463#if 0
464 if ( zone->cur_ref > zone->cur_top )
465 zone->cur_ref -= 64;
466 else if ( zone->cur_ref < zone->cur_bottom )
467 zone->cur_ref += 64;
468#endif
469 }
470 }
471
472 /* process the families now */
473
474 for ( num = 0; num < 2; num++ )
475 {
476 PSH_Blue_Zone zone1, zone2;
477 FT_UInt count1, count2;
478 PSH_Blue_Table normal, family;
479
480
481 switch ( num )
482 {
483 case 0:
484 normal = &blues->normal_top;
485 family = &blues->family_top;
486 break;
487
488 default:
489 normal = &blues->normal_bottom;
490 family = &blues->family_bottom;
491 }
492
493 zone1 = normal->zones;
494 count1 = normal->count;
495
496 for ( ; count1 > 0; count1--, zone1++ )
497 {
498 /* try to find a family zone whose reference position is less */
499 /* than 1 pixel far from the current zone */
500 zone2 = family->zones;
501 count2 = family->count;
502
503 for ( ; count2 > 0; count2--, zone2++ )
504 {
506
507
508 Delta = zone1->org_ref - zone2->org_ref;
509 if ( Delta < 0 )
510 Delta = -Delta;
511
512 if ( FT_MulFix( Delta, scale ) < 64 )
513 {
514 zone1->cur_top = zone2->cur_top;
515 zone1->cur_bottom = zone2->cur_bottom;
516 zone1->cur_ref = zone2->cur_ref;
517 zone1->cur_delta = zone2->cur_delta;
518 break;
519 }
520 }
521 }
522 }
523 }
#define NULL
Definition: types.h:112
FT_MulFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:509
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
#define FT_PIX_ROUND(x)
Definition: ftobjs.h:92
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_BOOL(x)
Definition: fttypes.h:591
signed int FT_Int
Definition: fttypes.h:220
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
GLuint GLuint num
Definition: glext.h:9618
DWORD zone
Definition: sec_mgr.c:1754
@ normal
Definition: optimize.h:166
PSH_Blue_ZoneRec zones[PS_GLOBALS_MAX_BLUE_ZONES]
Definition: pshglob.h:110
FT_Pos cur_bottom
Definition: pshglob.h:101
FT_Pos cur_top
Definition: pshglob.h:102
FT_Pos cur_delta
Definition: pshglob.h:100
FT_Pos cur_ref
Definition: pshglob.h:99
FT_Int org_ref
Definition: pshglob.h:94
FT_Fixed blue_scale
Definition: pshglob.h:123
PSH_Blue_TableRec family_bottom
Definition: pshglob.h:121
FT_Bool no_overshoots
Definition: pshglob.h:127
FT_Int blue_threshold
Definition: pshglob.h:125
PSH_Blue_TableRec normal_top
Definition: pshglob.h:118
FT_Int blue_shift
Definition: pshglob.h:124
PSH_Blue_TableRec normal_bottom
Definition: pshglob.h:119
PSH_Blue_TableRec family_top
Definition: pshglob.h:120
static ULONG Delta
Definition: xboxvideo.c:33

Referenced by psh_globals_set_scale().

◆ psh_blues_set_zones()

static void psh_blues_set_zones ( PSH_Blues  target,
FT_UInt  count,
FT_Short blues,
FT_UInt  count_others,
FT_Short other_blues,
FT_Int  fuzz,
FT_Int  family 
)
static

Definition at line 235 of file pshglob.c.

242 {
243 PSH_Blue_Table top_table, bot_table;
244 FT_UInt count_top, count_bot;
245
246
247 if ( family )
248 {
249 top_table = &target->family_top;
250 bot_table = &target->family_bottom;
251 }
252 else
253 {
254 top_table = &target->normal_top;
255 bot_table = &target->normal_bottom;
256 }
257
258 /* read the input blue zones, and build two sorted tables */
259 /* (one for the top zones, the other for the bottom zones) */
260 top_table->count = 0;
261 bot_table->count = 0;
262
263 /* first, the blues */
265 count, blues, top_table, bot_table );
267 count_others, other_blues, top_table, bot_table );
268
269 count_top = top_table->count;
270 count_bot = bot_table->count;
271
272 /* sanitize top table */
273 if ( count_top > 0 )
274 {
275 PSH_Blue_Zone zone = top_table->zones;
276
277
278 for ( count = count_top; count > 0; count--, zone++ )
279 {
280 FT_Int delta;
281
282
283 if ( count > 1 )
284 {
285 delta = zone[1].org_ref - zone[0].org_ref;
286 if ( zone->org_delta > delta )
287 zone->org_delta = delta;
288 }
289
290 zone->org_bottom = zone->org_ref;
291 zone->org_top = zone->org_delta + zone->org_ref;
292 }
293 }
294
295 /* sanitize bottom table */
296 if ( count_bot > 0 )
297 {
298 PSH_Blue_Zone zone = bot_table->zones;
299
300
301 for ( count = count_bot; count > 0; count--, zone++ )
302 {
303 FT_Int delta;
304
305
306 if ( count > 1 )
307 {
308 delta = zone[0].org_ref - zone[1].org_ref;
309 if ( zone->org_delta < delta )
310 zone->org_delta = delta;
311 }
312
313 zone->org_top = zone->org_ref;
314 zone->org_bottom = zone->org_delta + zone->org_ref;
315 }
316 }
317
318 /* expand top and bottom tables with blue fuzz */
319 {
320 FT_Int dim, top, bot, delta;
322
323
324 zone = top_table->zones;
325 count = count_top;
326
327 for ( dim = 1; dim >= 0; dim-- )
328 {
329 if ( count > 0 )
330 {
331 /* expand the bottom of the lowest zone normally */
332 zone->org_bottom -= fuzz;
333
334 /* expand the top and bottom of intermediate zones; */
335 /* checking that the interval is smaller than the fuzz */
336 top = zone->org_top;
337
338 for ( count--; count > 0; count-- )
339 {
340 bot = zone[1].org_bottom;
341 delta = bot - top;
342
343 if ( delta / 2 < fuzz )
344 zone[0].org_top = zone[1].org_bottom = top + delta / 2;
345 else
346 {
347 zone[0].org_top = top + fuzz;
348 zone[1].org_bottom = bot - fuzz;
349 }
350
351 zone++;
352 top = zone->org_top;
353 }
354
355 /* expand the top of the highest zone normally */
356 zone->org_top = top + fuzz;
357 }
358 zone = bot_table->zones;
359 count = count_bot;
360 }
361 }
362 }
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLenum target
Definition: glext.h:7315
static void psh_blues_set_zones_0(PSH_Blues target, FT_Bool is_others, FT_UInt read_count, FT_Short *read, PSH_Blue_Table top_table, PSH_Blue_Table bot_table)
Definition: pshglob.c:140

Referenced by psh_globals_new().

◆ psh_blues_set_zones_0()

static void psh_blues_set_zones_0 ( PSH_Blues  target,
FT_Bool  is_others,
FT_UInt  read_count,
FT_Short read,
PSH_Blue_Table  top_table,
PSH_Blue_Table  bot_table 
)
static

Definition at line 140 of file pshglob.c.

146 {
147 FT_UInt count_top = top_table->count;
148 FT_UInt count_bot = bot_table->count;
149 FT_Bool first = 1;
150
151 FT_UNUSED( target );
152
153
154 for ( ; read_count > 1; read_count -= 2 )
155 {
156 FT_Int reference, delta;
158 PSH_Blue_Zone zones, zone;
159 FT_Bool top;
160
161
162 /* read blue zone entry, and select target top/bottom zone */
163 top = 0;
164 if ( first || is_others )
165 {
166 reference = read[1];
167 delta = read[0] - reference;
168
169 zones = bot_table->zones;
170 count = count_bot;
171 first = 0;
172 }
173 else
174 {
175 reference = read[0];
176 delta = read[1] - reference;
177
178 zones = top_table->zones;
179 count = count_top;
180 top = 1;
181 }
182
183 /* insert into sorted table */
184 zone = zones;
185 for ( ; count > 0; count--, zone++ )
186 {
187 if ( reference < zone->org_ref )
188 break;
189
190 if ( reference == zone->org_ref )
191 {
192 FT_Int delta0 = zone->org_delta;
193
194
195 /* we have two zones on the same reference position -- */
196 /* only keep the largest one */
197 if ( delta < 0 )
198 {
199 if ( delta < delta0 )
200 zone->org_delta = delta;
201 }
202 else
203 {
204 if ( delta > delta0 )
205 zone->org_delta = delta;
206 }
207 goto Skip;
208 }
209 }
210
211 for ( ; count > 0; count-- )
212 zone[count] = zone[count-1];
213
214 zone->org_ref = reference;
215 zone->org_delta = delta;
216
217 if ( top )
218 count_top++;
219 else
220 count_bot++;
221
222 Skip:
223 read += 2;
224 }
225
226 top_table->count = count_top;
227 bot_table->count = count_bot;
228 }
#define read
Definition: acwin.h:96
#define FT_UNUSED(arg)
Definition: ftconfig.h:100
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
GLint reference
Definition: glext.h:11729
const GLint * first
Definition: glext.h:5794
STDMETHOD() Skip(THIS_ ULONG celt) PURE

Referenced by psh_blues_set_zones().

◆ psh_blues_snap_stem()

psh_blues_snap_stem ( PSH_Blues  blues,
FT_Int  stem_top,
FT_Int  stem_bot,
PSH_Alignment  alignment 
)

Definition at line 549 of file pshglob.c.

553 {
556 FT_Pos delta;
558 FT_Int no_shoots;
559
560
562
563 no_shoots = blues->no_overshoots;
564
565 /* look up stem top in top zones table */
566 table = &blues->normal_top;
567 count = table->count;
568 zone = table->zones;
569
570 for ( ; count > 0; count--, zone++ )
571 {
572 delta = SUB_LONG( stem_top, zone->org_bottom );
573 if ( delta < -blues->blue_fuzz )
574 break;
575
576 if ( stem_top <= zone->org_top + blues->blue_fuzz )
577 {
578 if ( no_shoots || delta <= blues->blue_threshold )
579 {
581 alignment->align_top = zone->cur_ref;
582 }
583 break;
584 }
585 }
586
587 /* look up stem bottom in bottom zones table */
588 table = &blues->normal_bottom;
589 count = table->count;
590 zone = table->zones + count-1;
591
592 for ( ; count > 0; count--, zone-- )
593 {
594 delta = SUB_LONG( zone->org_top, stem_bot );
595 if ( delta < -blues->blue_fuzz )
596 break;
597
598 if ( stem_bot >= zone->org_bottom - blues->blue_fuzz )
599 {
600 if ( no_shoots || delta < blues->blue_threshold )
601 {
603 alignment->align_bot = zone->cur_ref;
604 }
605 break;
606 }
607 }
608 }
_Check_return_ _Ret_maybenull_ _In_ size_t alignment
Definition: align.cpp:48
#define SUB_LONG(a, b)
Definition: ftcalc.h:475
#define PSH_BLUE_ALIGN_BOT
Definition: pshglob.h:146
#define PSH_BLUE_ALIGN_NONE
Definition: pshglob.h:144
#define PSH_BLUE_ALIGN_TOP
Definition: pshglob.h:145
FT_Int blue_fuzz
Definition: pshglob.h:126

Referenced by psh_hint_align().

◆ psh_calc_max_height()

static FT_Short psh_calc_max_height ( FT_UInt  num,
const FT_Short values,
FT_Short  cur_max 
)
static

Definition at line 528 of file pshglob.c.

531 {
533
534
535 for ( count = 0; count < num; count += 2 )
536 {
537 FT_Short cur_height = values[count + 1] - values[count];
538
539
540 if ( cur_height > cur_max )
541 cur_max = cur_height;
542 }
543
544 return cur_max;
545 }
signed short FT_Short
Definition: fttypes.h:198
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:5666

Referenced by psh_globals_new().

◆ psh_globals_destroy()

static void psh_globals_destroy ( PSH_Globals  globals)
static

Definition at line 620 of file pshglob.c.

621 {
622 if ( globals )
623 {
625
626
627 memory = globals->memory;
628 globals->dimension[0].stdw.count = 0;
629 globals->dimension[1].stdw.count = 0;
630
631 globals->blues.normal_top.count = 0;
632 globals->blues.normal_bottom.count = 0;
633 globals->blues.family_top.count = 0;
634 globals->blues.family_bottom.count = 0;
635
636 FT_FREE( globals );
637
638#ifdef DEBUG_HINTER
639 ps_debug_globals = NULL;
640#endif
641 }
642 }
#define FT_FREE(ptr)
Definition: ftmemory.h:328
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:65
static char memory[1024 *256]
Definition: process.c:116

Referenced by psh_globals_funcs_init().

◆ psh_globals_funcs_init()

psh_globals_funcs_init ( PSH_Globals_FuncsRec funcs)

Definition at line 788 of file pshglob.c.

789 {
790 funcs->create = psh_globals_new;
791 funcs->set_scale = psh_globals_set_scale;
792 funcs->destroy = psh_globals_destroy;
793 }
static void psh_globals_destroy(PSH_Globals globals)
Definition: pshglob.c:620
static FT_Error psh_globals_new(FT_Memory memory, T1_Private *priv, PSH_Globals *aglobals)
Definition: pshglob.c:646
psh_globals_set_scale(PSH_Globals globals, FT_Fixed x_scale, FT_Fixed y_scale, FT_Fixed x_delta, FT_Fixed y_delta)
Definition: pshglob.c:755
static struct __wine_debug_functions funcs
Definition: debug.c:59

Referenced by ps_hinter_init().

◆ psh_globals_new()

static FT_Error psh_globals_new ( FT_Memory  memory,
T1_Private priv,
PSH_Globals aglobals 
)
static

Definition at line 646 of file pshglob.c.

649 {
650 PSH_Globals globals = NULL;
652
653
654 if ( !FT_NEW( globals ) )
655 {
657 FT_Short* read;
658
659
660 globals->memory = memory;
661
662 /* copy standard widths */
663 {
664 PSH_Dimension dim = &globals->dimension[1];
665 PSH_Width write = dim->stdw.widths;
666
667
668 write->org = priv->standard_width[0];
669 write++;
670
671 read = priv->snap_widths;
672 for ( count = priv->num_snap_widths; count > 0; count-- )
673 {
674 write->org = *read;
675 write++;
676 read++;
677 }
678
679 dim->stdw.count = priv->num_snap_widths + 1;
680 }
681
682 /* copy standard heights */
683 {
684 PSH_Dimension dim = &globals->dimension[0];
685 PSH_Width write = dim->stdw.widths;
686
687
688 write->org = priv->standard_height[0];
689 write++;
690 read = priv->snap_heights;
691 for ( count = priv->num_snap_heights; count > 0; count-- )
692 {
693 write->org = *read;
694 write++;
695 read++;
696 }
697
698 dim->stdw.count = priv->num_snap_heights + 1;
699 }
700
701 /* copy blue zones */
702 psh_blues_set_zones( &globals->blues, priv->num_blue_values,
703 priv->blue_values, priv->num_other_blues,
704 priv->other_blues, priv->blue_fuzz, 0 );
705
706 psh_blues_set_zones( &globals->blues, priv->num_family_blues,
708 priv->family_other_blues, priv->blue_fuzz, 1 );
709
710 /* limit the BlueScale value to `1 / max_of_blue_zone_heights' */
711 {
712 FT_Fixed max_scale;
713 FT_Short max_height = 1;
714
715
716 max_height = psh_calc_max_height( priv->num_blue_values,
717 priv->blue_values,
718 max_height );
719 max_height = psh_calc_max_height( priv->num_other_blues,
720 priv->other_blues,
721 max_height );
722 max_height = psh_calc_max_height( priv->num_family_blues,
723 priv->family_blues,
724 max_height );
726 priv->family_other_blues,
727 max_height );
728
729 /* BlueScale is scaled 1000 times */
730 max_scale = FT_DivFix( 1000, max_height );
731 globals->blues.blue_scale = priv->blue_scale < max_scale
732 ? priv->blue_scale
733 : max_scale;
734 }
735
736 globals->blues.blue_shift = priv->blue_shift;
737 globals->blues.blue_fuzz = priv->blue_fuzz;
738
739 globals->dimension[0].scale_mult = 0;
740 globals->dimension[0].scale_delta = 0;
741 globals->dimension[1].scale_mult = 0;
742 globals->dimension[1].scale_delta = 0;
743
744#ifdef DEBUG_HINTER
745 ps_debug_globals = globals;
746#endif
747 }
748
749 *aglobals = globals;
750 return error;
751 }
#define write
Definition: acwin.h:97
FT_DivFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:608
#define FT_NEW(ptr)
Definition: ftmemory.h:330
signed long FT_Fixed
Definition: fttypes.h:287
int FT_Error
Definition: fttypes.h:299
typedefFT_BEGIN_HEADER struct PSH_GlobalsRec_ * PSH_Globals
Definition: pshints.h:41
#define error(str)
Definition: mkdosfs.c:1605
static void psh_blues_set_zones(PSH_Blues target, FT_UInt count, FT_Short *blues, FT_UInt count_others, FT_Short *other_blues, FT_Int fuzz, FT_Int family)
Definition: pshglob.c:235
static FT_Short psh_calc_max_height(FT_UInt num, const FT_Short *values, FT_Short cur_max)
Definition: pshglob.c:528
PSH_WidthsRec stdw
Definition: pshglob.h:84
PSH_WidthRec widths[PS_GLOBALS_MAX_STD_WIDTHS]
Definition: pshglob.h:77
FT_UInt count
Definition: pshglob.h:76
FT_Byte num_snap_widths
Definition: t1tables.h:160
FT_Byte num_other_blues
Definition: t1tables.h:143
FT_UShort standard_width[1]
Definition: t1tables.h:157
FT_Byte num_family_blues
Definition: t1tables.h:144
FT_Int blue_fuzz
Definition: t1tables.h:155
FT_Short snap_heights[13]
Definition: t1tables.h:166
FT_Short snap_widths[13]
Definition: t1tables.h:165
FT_Byte num_snap_heights
Definition: t1tables.h:161
FT_Short other_blues[10]
Definition: t1tables.h:148
FT_Byte num_family_other_blues
Definition: t1tables.h:145
FT_UShort standard_height[1]
Definition: t1tables.h:158
FT_Short family_blues[14]
Definition: t1tables.h:150
FT_Int blue_shift
Definition: t1tables.h:154
FT_Short family_other_blues[10]
Definition: t1tables.h:151
FT_Short blue_values[14]
Definition: t1tables.h:147
FT_Byte num_blue_values
Definition: t1tables.h:142
FT_Fixed blue_scale
Definition: t1tables.h:153

Referenced by psh_globals_funcs_init().

◆ psh_globals_scale_widths()

static void psh_globals_scale_widths ( PSH_Globals  globals,
FT_UInt  direction 
)
static

Definition at line 42 of file pshglob.c.

44 {
45 PSH_Dimension dim = &globals->dimension[direction];
46 PSH_Widths stdw = &dim->stdw;
47 FT_UInt count = stdw->count;
48 PSH_Width width = stdw->widths;
49 PSH_Width stand = width; /* standard width/height */
51
52
53 if ( count > 0 )
54 {
55 width->cur = FT_MulFix( width->org, scale );
56 width->fit = FT_PIX_ROUND( width->cur );
57
58 width++;
59 count--;
60
61 for ( ; count > 0; count--, width++ )
62 {
63 FT_Pos w, dist;
64
65
66 w = FT_MulFix( width->org, scale );
67 dist = w - stand->cur;
68
69 if ( dist < 0 )
70 dist = -dist;
71
72 if ( dist < 128 )
73 w = stand->cur;
74
75 width->cur = w;
76 width->fit = FT_PIX_ROUND( w );
77 }
78 }
79 }
GLint GLint GLsizei width
Definition: gl.h:1546
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
FT_Fixed scale_mult
Definition: pshglob.h:85
FT_Pos cur
Definition: pshglob.h:67

Referenced by psh_globals_set_scale().

◆ psh_globals_set_scale()

psh_globals_set_scale ( PSH_Globals  globals,
FT_Fixed  x_scale,
FT_Fixed  y_scale,
FT_Fixed  x_delta,
FT_Fixed  y_delta 
)

Definition at line 755 of file pshglob.c.

760 {
761 PSH_Dimension dim;
762
763
764 dim = &globals->dimension[0];
765 if ( x_scale != dim->scale_mult ||
766 x_delta != dim->scale_delta )
767 {
768 dim->scale_mult = x_scale;
769 dim->scale_delta = x_delta;
770
771 psh_globals_scale_widths( globals, 0 );
772 }
773
774 dim = &globals->dimension[1];
775 if ( y_scale != dim->scale_mult ||
776 y_delta != dim->scale_delta )
777 {
778 dim->scale_mult = y_scale;
779 dim->scale_delta = y_delta;
780
781 psh_globals_scale_widths( globals, 1 );
782 psh_blues_scale_zones( &globals->blues, y_scale, y_delta );
783 }
784 }
static void psh_globals_scale_widths(PSH_Globals globals, FT_UInt direction)
Definition: pshglob.c:42
static void psh_blues_scale_zones(PSH_Blues blues, FT_Fixed scale, FT_Pos delta)
Definition: pshglob.c:367
FT_Fixed scale_delta
Definition: pshglob.h:86

Referenced by ps_hints_apply(), and psh_globals_funcs_init().