w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gr_slot.cpp File Reference
#include "graphite2/Segment.h"
#include "inc/Segment.h"
#include "inc/Slot.h"
#include "inc/Font.h"
Include dependency graph for gr_slot.cpp:

Go to the source code of this file.

Functions

const gr_slotgr_slot_next_in_segment (const gr_slot *p)
 
const gr_slotgr_slot_prev_in_segment (const gr_slot *p)
 
const gr_slotgr_slot_attached_to (const gr_slot *p)
 
const gr_slotgr_slot_first_attachment (const gr_slot *p)
 
const gr_slotgr_slot_next_sibling_attachment (const gr_slot *p)
 
unsigned short gr_slot_gid (const gr_slot *p)
 
float gr_slot_origin_X (const gr_slot *p)
 
float gr_slot_origin_Y (const gr_slot *p)
 
float gr_slot_advance_X (const gr_slot *p, const gr_face *face, const gr_font *font)
 
float gr_slot_advance_Y (const gr_slot *p, GR_MAYBE_UNUSED const gr_face *face, const gr_font *font)
 
int gr_slot_before (const gr_slot *p)
 
int gr_slot_after (const gr_slot *p)
 
unsigned int gr_slot_index (const gr_slot *p)
 
int gr_slot_attr (const gr_slot *p, const gr_segment *pSeg, gr_attrCode index, gr_uint8 subindex)
 
int gr_slot_can_insert_before (const gr_slot *p)
 
int gr_slot_original (const gr_slot *p)
 
void gr_slot_linebreak_before (gr_slot *p)
 

Function Documentation

◆ gr_slot_advance_X()

float gr_slot_advance_X ( const gr_slot p,
const gr_face face,
const gr_font font 
)

Returns the glyph advance for this glyph as adjusted for kerning

Parameters
pSlot to give results for
facegr_face of the glyphs. May be NULL if unhinted advances used
fontgr_font to scale for pixel results. If NULL returns design units advance. If not NULL then returns pixel advance based on hinted or scaled glyph advances in the font. face must be passed for hinted advances to be used.

Definition at line 90 of file gr_slot.cpp.

References assert(), face, FT_FaceRec_::glyph, glyphs(), p, res, and scale.

◆ gr_slot_advance_Y()

float gr_slot_advance_Y ( const gr_slot p,
GR_MAYBE_UNUSED const gr_face face,
const gr_font font 
)

Definition at line 107 of file gr_slot.cpp.

References assert(), p, and res.

◆ gr_slot_after()

int gr_slot_after ( const gr_slot p)

Returns the gr_char_info index after us

Returns the index of the gr_char_info that a cursor after this slot would put an underlying cursor after. This may also be interpretted as each slot holding a set of char_infos that it is associated with and this function returning the index of the char_info with the highest index, from this set.

Definition at line 124 of file gr_slot.cpp.

References assert(), and p.

◆ gr_slot_attached_to()

const gr_slot* gr_slot_attached_to ( const gr_slot p)

Returns the attachment parent slot of this slot.

Attached slots form a tree. This returns the parent of this slot in that tree. A base glyph which is not attached to another glyph, always returns NULL.

Definition at line 48 of file gr_slot.cpp.

References assert(), and p.

◆ gr_slot_attr()

int gr_slot_attr ( const gr_slot p,
const gr_segment pSeg,
enum gr_attrCode  index,
gr_uint8  subindex 
)

Return a slot attribute value

Given a slot and an attribute along with a possible subattribute, return the corresponding value in the slot. See enum gr_attrCode for details of each attribute.

Definition at line 136 of file gr_slot.cpp.

References assert(), and p.

◆ gr_slot_before()

int gr_slot_before ( const gr_slot p)

Returns the gr_char_info index before us

Returns the index of the gr_char_info that a cursor before this slot, would put an underlying cursor before. This may also be interpretted as each slot holding a set of char_infos that it is associated with and this function returning the index of the char_info with lowest index, from this set.

Definition at line 117 of file gr_slot.cpp.

References assert(), and p.

◆ gr_slot_can_insert_before()

int gr_slot_can_insert_before ( const gr_slot p)

Returns whether text may be inserted before this glyph.

This indicates whether a cursor can be put before this slot. It applies to base glyphs that have no parent as well as attached glyphs that have the .insert attribute explicitly set to true. This is the primary mechanism for identifying contiguous sequences of base plus diacritics.

Definition at line 143 of file gr_slot.cpp.

References assert(), and p.

◆ gr_slot_first_attachment()

const gr_slot* gr_slot_first_attachment ( const gr_slot p)

Returns the first slot attached to this slot.

Attached slots form a singly linked list from the parent. This returns the first slot in that list. Note that this is a reference to another slot that is also in the main segment doubly linked list.

if gr_slot_first_attachment(p) != NULL then gr_slot_attached_to(gr_slot_first_attachment(p)) == p.

Definition at line 55 of file gr_slot.cpp.

References assert(), and p.

◆ gr_slot_gid()

unsigned short gr_slot_gid ( const gr_slot p)

Returns glyph id of the slot

Each slot has a glyphid which is rendered at the position given by the slot. This glyphid is the real glyph to be rendered and never a pseudo glyph.

Definition at line 69 of file gr_slot.cpp.

References assert(), and p.

◆ gr_slot_index()

unsigned int gr_slot_index ( const gr_slot p)

Returns the index of this slot in the segment

Returns the index given to this slot during final positioning. This corresponds to the value returned br gr_cinfo_before() and gr_cinfo_after()

Definition at line 130 of file gr_slot.cpp.

References assert(), and p.

Referenced by findNextGraphiteBreak().

◆ gr_slot_linebreak_before()

void gr_slot_linebreak_before ( gr_slot p)

Breaks a segment into lines.

Breaks the slot linked list at the given point in the linked list. It is up to the application to keep track of the first slot on each line.

Definition at line 156 of file gr_slot.cpp.

References assert(), NULL, p, and prev.

◆ gr_slot_next_in_segment()

const gr_slot* gr_slot_next_in_segment ( const gr_slot p)

Returns the next slot along in the segment.

Slots are held in a linked list. This returns the next in the linked list. The slot may or may not be attached to another slot. Returns NULL at the end of the segment.

Definition at line 36 of file gr_slot.cpp.

References assert(), and p.

Referenced by findNextGraphiteBreak().

◆ gr_slot_next_sibling_attachment()

const gr_slot* gr_slot_next_sibling_attachment ( const gr_slot p)

Returns the next slot attached to our attachment parent.

This returns the next slot in the singly linked list of slots attached to this slot's parent. If there are no more such slots, NULL is returned. If there is no parent, i.e. the passed slot is a cluster base, then the next cluster base in graphical order (ltr, even for rtl text) is returned.

if gr_slot_next_sibling_attachment(p) != NULL then gr_slot_attached_to(gr_slot_next_sibling_attachment(p)) == gr_slot_attached_to(p).

Definition at line 62 of file gr_slot.cpp.

References assert(), and p.

◆ gr_slot_origin_X()

float gr_slot_origin_X ( const gr_slot p)

Returns X offset of glyph from start of segment

Definition at line 76 of file gr_slot.cpp.

References assert(), and p.

◆ gr_slot_origin_Y()

float gr_slot_origin_Y ( const gr_slot p)

Returns Y offset of glyph from start of segment

Definition at line 83 of file gr_slot.cpp.

References assert(), and p.

◆ gr_slot_original()

int gr_slot_original ( const gr_slot p)

Returns the original gr_char_info index this slot refers to.

Each Slot has a gr_char_info that it originates from. This is that gr_char_info. The index is passed to gr_seg_cinfo(). This information is useful for testing.

Definition at line 150 of file gr_slot.cpp.

References assert(), and p.

◆ gr_slot_prev_in_segment()

const gr_slot* gr_slot_prev_in_segment ( const gr_slot p)

Returns the previous slot along in the segment.

Slots are held in a doubly linked list. This returns the previos slot in the linked list. This slot may or may not be attached to it. Returns NULL at the start of the segment.

Definition at line 42 of file gr_slot.cpp.

References assert(), and p.