freetype: fix flags integer size
This commit is contained in:
parent
e13921c355
commit
b471a9cc98
6 changed files with 39 additions and 39 deletions
|
|
@ -161,7 +161,7 @@ pub fn setCharmap(self: Face, char_map: *CharMap) Error!void {
|
|||
}
|
||||
|
||||
pub fn getFSTypeFlags(self: Face) FSType {
|
||||
return FSType.from(@intCast(u10, c.FT_Get_FSType_Flags(self.handle)));
|
||||
return FSType.from(c.FT_Get_FSType_Flags(self.handle));
|
||||
}
|
||||
|
||||
pub fn getCharVariantIndex(self: Face, char: u32, variant_selector: u32) ?u32 {
|
||||
|
|
@ -272,11 +272,11 @@ pub fn faceIndex(self: Face) u32 {
|
|||
}
|
||||
|
||||
pub fn faceFlags(self: Face) FaceFlags {
|
||||
return FaceFlags.from(@intCast(u19, self.handle.*.face_flags));
|
||||
return FaceFlags.from(self.handle.*.face_flags);
|
||||
}
|
||||
|
||||
pub fn styleFlags(self: Face) StyleFlags {
|
||||
return StyleFlags.from(@intCast(u2, self.handle.*.style_flags));
|
||||
return StyleFlags.from(self.handle.*.style_flags);
|
||||
}
|
||||
|
||||
pub fn numGlyphs(self: Face) u32 {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ const GlyphSlot = @This();
|
|||
|
||||
pub const SubGlyphInfo = struct {
|
||||
index: i32,
|
||||
flags: u32,
|
||||
flags: c_uint,
|
||||
arg1: i32,
|
||||
arg2: i32,
|
||||
transform: Matrix,
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ pub const PaletteData = struct {
|
|||
}
|
||||
|
||||
pub fn paletteFlag(self: PaletteData, index: u32) PaletteFlags {
|
||||
return PaletteFlags.from(@intCast(u2, self.handle.palette_flags[index]));
|
||||
return PaletteFlags.from(self.handle.palette_flags[index]);
|
||||
}
|
||||
|
||||
pub fn numPaletteEntries(self: PaletteData) u16 {
|
||||
|
|
@ -136,12 +136,12 @@ pub const PaletteFlags = packed struct {
|
|||
for_dark_background = c.FT_PALETTE_FOR_DARK_BACKGROUND,
|
||||
};
|
||||
|
||||
pub fn from(bits: u2) PaletteFlags {
|
||||
pub fn from(bits: c_int) PaletteFlags {
|
||||
return utils.bitFieldsToStruct(PaletteFlags, Flag, bits);
|
||||
}
|
||||
|
||||
pub fn to(flags: PaletteFlags) u2 {
|
||||
return utils.structToBitFields(u2, Flag, flags);
|
||||
pub fn to(flags: PaletteFlags) c_int {
|
||||
return utils.structToBitFields(c_int, Flag, flags);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -125,12 +125,12 @@ pub const LoadFlags = packed struct {
|
|||
color = c.FT_LOAD_COLOR,
|
||||
};
|
||||
|
||||
pub fn from(bits: u24) LoadFlags {
|
||||
pub fn from(bits: c_int) LoadFlags {
|
||||
return utils.bitFieldsToStruct(LoadFlags, Flag, bits);
|
||||
}
|
||||
|
||||
pub fn cast(self: LoadFlags) u24 {
|
||||
return utils.structToBitFields(u24, Flag, self);
|
||||
pub fn cast(self: LoadFlags) c_int {
|
||||
return utils.structToBitFields(c_int, Flag, self);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -177,12 +177,12 @@ pub const FaceFlags = packed struct {
|
|||
sbix_overlay = c.FT_FACE_FLAG_SBIX_OVERLAY,
|
||||
};
|
||||
|
||||
pub fn from(bits: u19) FaceFlags {
|
||||
pub fn from(bits: c_long) FaceFlags {
|
||||
return utils.bitFieldsToStruct(FaceFlags, Flag, bits);
|
||||
}
|
||||
|
||||
pub fn cast(self: FaceFlags) u19 {
|
||||
return utils.structToBitFields(u19, Flag, self);
|
||||
pub fn cast(self: FaceFlags) c_long {
|
||||
return utils.structToBitFields(c_long, Flag, self);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -203,12 +203,12 @@ pub const FSType = packed struct {
|
|||
bitmap_embedding_only = c.FT_FSTYPE_BITMAP_EMBEDDING_ONLY,
|
||||
};
|
||||
|
||||
pub fn from(bits: u10) FSType {
|
||||
pub fn from(bits: c_int) FSType {
|
||||
return utils.bitFieldsToStruct(FSType, Flag, bits);
|
||||
}
|
||||
|
||||
pub fn cast(self: FSType) u10 {
|
||||
return utils.structToBitFields(u10, Flag, self);
|
||||
pub fn cast(self: FSType) c_int {
|
||||
return utils.structToBitFields(c_int, Flag, self);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -221,12 +221,12 @@ pub const StyleFlags = packed struct {
|
|||
bold = c.FT_STYLE_FLAG_BOLD,
|
||||
};
|
||||
|
||||
pub fn from(bits: u2) StyleFlags {
|
||||
pub fn from(bits: c_long) StyleFlags {
|
||||
return utils.bitFieldsToStruct(StyleFlags, Flag, bits);
|
||||
}
|
||||
|
||||
pub fn cast(self: StyleFlags) u2 {
|
||||
return utils.structToBitFields(u2, Flag, self);
|
||||
pub fn cast(self: StyleFlags) c_long {
|
||||
return utils.structToBitFields(c_long, Flag, self);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -245,12 +245,12 @@ pub const OpenFlags = packed struct {
|
|||
params = c.FT_OPEN_PARAMS,
|
||||
};
|
||||
|
||||
pub fn from(bits: u5) OpenFlags {
|
||||
pub fn from(bits: c_uint) OpenFlags {
|
||||
return utils.bitFieldsToStruct(OpenFlags, Flag, bits);
|
||||
}
|
||||
|
||||
pub fn cast(flags: OpenFlags) u5 {
|
||||
return utils.structToBitFields(u5, Flag, flags);
|
||||
pub fn cast(flags: OpenFlags) c_uint {
|
||||
return utils.structToBitFields(c_uint, Flag, flags);
|
||||
}
|
||||
};
|
||||
pub const OpenArgs = struct {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ pub const GlyphInfo = extern struct {
|
|||
var2: u32,
|
||||
|
||||
pub fn getFlags(self: GlyphInfo) GlyphFlags {
|
||||
return GlyphFlags.from(@intCast(u2, hb_glyph_info_get_glyph_flags(&self)));
|
||||
return GlyphFlags.from(hb_glyph_info_get_glyph_flags(&self));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -52,12 +52,12 @@ pub const GlyphFlags = packed struct {
|
|||
unsafe_to_concat = c.HB_GLYPH_FLAG_UNSAFE_TO_CONCAT,
|
||||
};
|
||||
|
||||
pub fn from(bits: u2) GlyphFlags {
|
||||
pub fn from(bits: c_uint) GlyphFlags {
|
||||
return utils.bitFieldsToStruct(GlyphFlags, Flag, bits);
|
||||
}
|
||||
|
||||
pub fn cast(self: GlyphFlags) u2 {
|
||||
return utils.structToBitFields(u2, Flag, self);
|
||||
pub fn cast(self: GlyphFlags) c_uint {
|
||||
return utils.structToBitFields(c_uint, Flag, self);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -146,12 +146,12 @@ pub const DiffFlags = packed struct {
|
|||
position_mismatch = c.HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH,
|
||||
};
|
||||
|
||||
pub fn from(bits: u8) DiffFlags {
|
||||
pub fn from(bits: c_uint) DiffFlags {
|
||||
return utils.bitFieldsToStruct(DiffFlags, Flag, bits);
|
||||
}
|
||||
|
||||
pub fn cast(self: DiffFlags) u8 {
|
||||
return utils.structToBitFields(u8, Flag, self);
|
||||
pub fn cast(self: DiffFlags) c_uint {
|
||||
return utils.structToBitFields(c_uint, Flag, self);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -175,12 +175,12 @@ pub const Buffer = struct {
|
|||
produce_unsafe_to_concat = c.HB_BUFFER_FLAG_PRODUCE_UNSAFE_TO_CONCAT,
|
||||
};
|
||||
|
||||
pub fn from(bits: u7) Flags {
|
||||
pub fn from(bits: c_uint) Flags {
|
||||
return utils.bitFieldsToStruct(Flags, Flag, bits);
|
||||
}
|
||||
|
||||
pub fn cast(self: Flags) u7 {
|
||||
return utils.structToBitFields(u7, Flag, self);
|
||||
pub fn cast(self: Flags) c_uint {
|
||||
return utils.structToBitFields(c_uint, Flag, self);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -292,7 +292,7 @@ pub const Buffer = struct {
|
|||
}
|
||||
|
||||
pub fn getFlags(self: Buffer) Flags {
|
||||
return Flags.from(@intCast(u7, c.hb_buffer_get_flags(self.handle)));
|
||||
return Flags.from(c.hb_buffer_get_flags(self.handle));
|
||||
}
|
||||
|
||||
pub fn setFlags(self: Buffer, flags: Flags) void {
|
||||
|
|
@ -388,7 +388,7 @@ pub const Buffer = struct {
|
|||
}
|
||||
|
||||
pub fn diff(self: Buffer, ref: Buffer, dottedcircle_glyph: u32, position_fuzz: u32) DiffFlags {
|
||||
return DiffFlags.from(@intCast(u8, c.hb_buffer_diff(self.handle, ref.handle, dottedcircle_glyph, position_fuzz)));
|
||||
return DiffFlags.from(c.hb_buffer_diff(self.handle, ref.handle, dottedcircle_glyph, position_fuzz));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ pub const Outline = struct {
|
|||
}
|
||||
|
||||
pub fn flags(self: Outline) OutlineFlags {
|
||||
return OutlineFlags.from(@intCast(u19, self.handle.*.flags));
|
||||
return OutlineFlags.from(self.handle.*.flags);
|
||||
}
|
||||
|
||||
pub fn copy(self: Outline) Error!Outline {
|
||||
|
|
@ -299,11 +299,11 @@ pub const OutlineFlags = packed struct {
|
|||
single_pass = c.FT_OUTLINE_SINGLE_PASS,
|
||||
};
|
||||
|
||||
pub fn from(bits: u24) OutlineFlags {
|
||||
pub fn from(bits: c_int) OutlineFlags {
|
||||
return utils.bitFieldsToStruct(OutlineFlags, Flag, bits);
|
||||
}
|
||||
|
||||
pub fn cast(self: OutlineFlags) u24 {
|
||||
return utils.structToBitFields(u24, Flag, self);
|
||||
pub fn cast(self: OutlineFlags) c_int {
|
||||
return utils.structToBitFields(c_int, Flag, self);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue