Skip to content

Commit e68b1d5

Browse files
committed
Implement vqt_real_extentn
1 parent eede07c commit e68b1d5

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

SRCFILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ _VDI_EXTENSIONS = \
287287
n_vqt_pairkern.c \
288288
n_vqt_real_extent.c \
289289
u_vqt_real_extent.c \
290+
n_vqt_real_extentn.c \
291+
u_vqt_real_extentn.c \
290292
n_vqt_real_extent16n.c \
291293
n_vqt_trackkern.c \
292294
n_vqt_xfntinfo.c \

mt_gemx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ short vqt_name_and_id (VdiHdl, short font_format,
10631063
void vqt_pairkern (VdiHdl, short ch1, short ch2, long *x, long *y);
10641064

10651065
void vqt_real_extent (VdiHdl, short x, short y, const char *string, short extent[]);
1066+
void vqt_real_extentn (VdiHdl, short x, short y, const char *string, short num, short extent[]);
10661067
void vqt_real_extent16n (VdiHdl, short x, short y, const WCHAR *wstring, short num, short extent[]);
10671068
void vqt_trackkern (VdiHdl, long *x, long *y);
10681069
short vqt_xfntinfo (VdiHdl, short flags, short id,
@@ -1135,6 +1136,7 @@ short udef_vqt_name_and_id (VdiHdl, short font_format,
11351136
#define udef_vqt_pairkern vqt_pairkern
11361137
/** @ingroup force_udef */
11371138
void udef_vqt_real_extent (VdiHdl, short x, short y, const char *string, short extent[]);
1139+
void udef_vqt_real_extentn (VdiHdl, short x, short y, const char *string, short num, short extent[]);
11381140
/** UDEF version of vqt_real_extent16n(). See \ref overviewUDEF for details about UDEF feature */
11391141
#define udef_vqt_real_extent16n vqt_real_extent16n
11401142
/** UDEF version of vqt_trackkern(). See \ref overviewUDEF for details about UDEF feature */

n_vqt_real_extentn.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#include "gem_vdiP.h"
2+
#include "mt_gemx.h"
3+
4+
/** This function is only available if you use NVDI.
5+
* It returns the bounding box (eventually a quadrilateral, not a rectangle) for
6+
* text output at \p x, \p y. This function considers all text effects, rotation,
7+
* skewing, pair kerning, track kerning, characters which are extending beyond the
8+
* em square, horizontal and vertical alignment.
9+
*
10+
* @param handle Device handle
11+
* @param x x-coordinate
12+
* @param y y-coordinate
13+
* @param string string
14+
* @param extent coordinates of the bounding box
15+
*
16+
* @since NVDI 3.00
17+
*
18+
*
19+
*
20+
*/
21+
22+
void
23+
vqt_real_extentn (short handle, short x, short y, const char *string, short num, short extent[])
24+
{
25+
short vdi_control[VDI_CNTRLMAX];
26+
short vdi_intin[VDI_INTINMAX];
27+
short vdi_ptsin[2];
28+
29+
VDI_PARAMS(vdi_control, vdi_intin, vdi_ptsin, vdi_dummy, extent);
30+
31+
num = vdi_str2array_n (string, vdi_intin, num);
32+
33+
vdi_ptsin[0] = x;
34+
vdi_ptsin[1] = y;
35+
36+
VDI_TRAP_ESC (vdi_params, handle, 240,4200, 1,num);
37+
}

u_vqt_real_extentn.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include "gem_vdiP.h"
2+
#include "mt_gemx.h"
3+
#include "vdi_userdef.h"
4+
5+
6+
/** UDEF version of vqt_real_extentn(). See \ref overviewUDEF for details about UDEF feature
7+
*/
8+
9+
void
10+
udef_vqt_real_extentn (short handle, short x, short y, const char *string, short num, short extent[])
11+
{
12+
VDI_PARAMS(_VDIParBlk.vdi_control, _VDIParBlk.vdi_intin, _VDIParBlk.vdi_ptsin, vdi_dummy, extent);
13+
14+
num = vdi_str2array_n (string, _VDIParBlk.vdi_intin, num);
15+
16+
_VDIParBlk.vdi_ptsin[0] = x;
17+
_VDIParBlk.vdi_ptsin[1] = y;
18+
19+
VDI_TRAP_ESC (vdi_params, handle, 240,4200, 1,num);
20+
}

0 commit comments

Comments
 (0)