-- | Copyright : Will Thompson and Iñaki García Etxebarria -- License : LGPL-2.1 -- Maintainer : Iñaki García Etxebarria #if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__)) #define ENABLE_OVERLOADING #endif module GI.HarfBuzz.Functions ( -- * Methods -- ** aatLayoutFeatureTypeGetNameId #method:aatLayoutFeatureTypeGetNameId# aatLayoutFeatureTypeGetNameId , -- ** aatLayoutFeatureTypeGetSelectorInfos #method:aatLayoutFeatureTypeGetSelectorInfos# aatLayoutFeatureTypeGetSelectorInfos , -- ** aatLayoutGetFeatureTypes #method:aatLayoutGetFeatureTypes# aatLayoutGetFeatureTypes , -- ** aatLayoutHasPositioning #method:aatLayoutHasPositioning# aatLayoutHasPositioning , -- ** aatLayoutHasSubstitution #method:aatLayoutHasSubstitution# aatLayoutHasSubstitution , -- ** aatLayoutHasTracking #method:aatLayoutHasTracking# aatLayoutHasTracking , -- ** blobCopyWritableOrFail #method:blobCopyWritableOrFail# blobCopyWritableOrFail , -- ** blobCreateFromFile #method:blobCreateFromFile# blobCreateFromFile , -- ** blobCreateFromFileOrFail #method:blobCreateFromFileOrFail# blobCreateFromFileOrFail , -- ** blobCreateSubBlob #method:blobCreateSubBlob# blobCreateSubBlob , -- ** blobGetData #method:blobGetData# blobGetData , -- ** blobGetDataWritable #method:blobGetDataWritable# blobGetDataWritable , -- ** blobGetEmpty #method:blobGetEmpty# blobGetEmpty , -- ** blobGetLength #method:blobGetLength# blobGetLength , -- ** blobIsImmutable #method:blobIsImmutable# blobIsImmutable , -- ** blobMakeImmutable #method:blobMakeImmutable# blobMakeImmutable , -- ** bufferAdd #method:bufferAdd# bufferAdd , -- ** bufferAddCodepoints #method:bufferAddCodepoints# bufferAddCodepoints , -- ** bufferAddLatin1 #method:bufferAddLatin1# bufferAddLatin1 , -- ** bufferAddUtf16 #method:bufferAddUtf16# bufferAddUtf16 , -- ** bufferAddUtf32 #method:bufferAddUtf32# bufferAddUtf32 , -- ** bufferAddUtf8 #method:bufferAddUtf8# bufferAddUtf8 , -- ** bufferAllocationSuccessful #method:bufferAllocationSuccessful# bufferAllocationSuccessful , -- ** bufferAppend #method:bufferAppend# bufferAppend , -- ** bufferClearContents #method:bufferClearContents# bufferClearContents , -- ** bufferCreate #method:bufferCreate# bufferCreate , -- ** bufferCreateSimilar #method:bufferCreateSimilar# bufferCreateSimilar , -- ** bufferDeserializeGlyphs #method:bufferDeserializeGlyphs# bufferDeserializeGlyphs , -- ** bufferDeserializeUnicode #method:bufferDeserializeUnicode# bufferDeserializeUnicode , -- ** bufferDiff #method:bufferDiff# bufferDiff , -- ** bufferGetClusterLevel #method:bufferGetClusterLevel# bufferGetClusterLevel , -- ** bufferGetContentType #method:bufferGetContentType# bufferGetContentType , -- ** bufferGetDirection #method:bufferGetDirection# bufferGetDirection , -- ** bufferGetEmpty #method:bufferGetEmpty# bufferGetEmpty , -- ** bufferGetFlags #method:bufferGetFlags# bufferGetFlags , -- ** bufferGetGlyphInfos #method:bufferGetGlyphInfos# bufferGetGlyphInfos , -- ** bufferGetGlyphPositions #method:bufferGetGlyphPositions# bufferGetGlyphPositions , -- ** bufferGetInvisibleGlyph #method:bufferGetInvisibleGlyph# bufferGetInvisibleGlyph , -- ** bufferGetLanguage #method:bufferGetLanguage# bufferGetLanguage , -- ** bufferGetLength #method:bufferGetLength# bufferGetLength , -- ** bufferGetNotFoundGlyph #method:bufferGetNotFoundGlyph# bufferGetNotFoundGlyph , -- ** bufferGetNotFoundVariationSelectorGlyph #method:bufferGetNotFoundVariationSelectorGlyph# bufferGetNotFoundVariationSelectorGlyph , -- ** bufferGetRandomState #method:bufferGetRandomState# bufferGetRandomState , -- ** bufferGetReplacementCodepoint #method:bufferGetReplacementCodepoint# bufferGetReplacementCodepoint , -- ** bufferGetScript #method:bufferGetScript# bufferGetScript , -- ** bufferGetSegmentProperties #method:bufferGetSegmentProperties# bufferGetSegmentProperties , -- ** bufferGetUnicodeFuncs #method:bufferGetUnicodeFuncs# bufferGetUnicodeFuncs , -- ** bufferGuessSegmentProperties #method:bufferGuessSegmentProperties# bufferGuessSegmentProperties , -- ** bufferHasPositions #method:bufferHasPositions# bufferHasPositions , -- ** bufferNormalizeGlyphs #method:bufferNormalizeGlyphs# bufferNormalizeGlyphs , -- ** bufferPreAllocate #method:bufferPreAllocate# bufferPreAllocate , -- ** bufferReset #method:bufferReset# bufferReset , -- ** bufferReverse #method:bufferReverse# bufferReverse , -- ** bufferReverseClusters #method:bufferReverseClusters# bufferReverseClusters , -- ** bufferReverseRange #method:bufferReverseRange# bufferReverseRange , -- ** bufferSerialize #method:bufferSerialize# bufferSerialize , -- ** bufferSerializeFormatFromString #method:bufferSerializeFormatFromString# bufferSerializeFormatFromString , -- ** bufferSerializeFormatToString #method:bufferSerializeFormatToString# bufferSerializeFormatToString , -- ** bufferSerializeGlyphs #method:bufferSerializeGlyphs# bufferSerializeGlyphs , -- ** bufferSerializeListFormats #method:bufferSerializeListFormats# bufferSerializeListFormats , -- ** bufferSerializeUnicode #method:bufferSerializeUnicode# bufferSerializeUnicode , -- ** bufferSetClusterLevel #method:bufferSetClusterLevel# bufferSetClusterLevel , -- ** bufferSetContentType #method:bufferSetContentType# bufferSetContentType , -- ** bufferSetDirection #method:bufferSetDirection# bufferSetDirection , -- ** bufferSetFlags #method:bufferSetFlags# bufferSetFlags , -- ** bufferSetInvisibleGlyph #method:bufferSetInvisibleGlyph# bufferSetInvisibleGlyph , -- ** bufferSetLanguage #method:bufferSetLanguage# bufferSetLanguage , -- ** bufferSetLength #method:bufferSetLength# bufferSetLength , -- ** bufferSetNotFoundGlyph #method:bufferSetNotFoundGlyph# bufferSetNotFoundGlyph , -- ** bufferSetNotFoundVariationSelectorGlyph #method:bufferSetNotFoundVariationSelectorGlyph# bufferSetNotFoundVariationSelectorGlyph , -- ** bufferSetRandomState #method:bufferSetRandomState# bufferSetRandomState , -- ** bufferSetReplacementCodepoint #method:bufferSetReplacementCodepoint# bufferSetReplacementCodepoint , -- ** bufferSetScript #method:bufferSetScript# bufferSetScript , -- ** bufferSetSegmentProperties #method:bufferSetSegmentProperties# bufferSetSegmentProperties , -- ** bufferSetUnicodeFuncs #method:bufferSetUnicodeFuncs# bufferSetUnicodeFuncs , -- ** calloc #method:calloc# calloc , -- ** colorGetAlpha #method:colorGetAlpha# colorGetAlpha , -- ** colorGetBlue #method:colorGetBlue# colorGetBlue , -- ** colorGetGreen #method:colorGetGreen# colorGetGreen , -- ** colorGetRed #method:colorGetRed# colorGetRed , -- ** colorLineGetColorStops #method:colorLineGetColorStops# colorLineGetColorStops , -- ** colorLineGetExtend #method:colorLineGetExtend# colorLineGetExtend , -- ** directionFromString #method:directionFromString# directionFromString , -- ** directionToString #method:directionToString# directionToString , -- ** drawClosePath #method:drawClosePath# drawClosePath , -- ** drawCubicTo #method:drawCubicTo# drawCubicTo , -- ** drawFuncsCreate #method:drawFuncsCreate# drawFuncsCreate , -- ** drawFuncsGetEmpty #method:drawFuncsGetEmpty# drawFuncsGetEmpty , -- ** drawFuncsIsImmutable #method:drawFuncsIsImmutable# drawFuncsIsImmutable , -- ** drawFuncsMakeImmutable #method:drawFuncsMakeImmutable# drawFuncsMakeImmutable , -- ** drawLineTo #method:drawLineTo# drawLineTo , -- ** drawMoveTo #method:drawMoveTo# drawMoveTo , -- ** drawQuadraticTo #method:drawQuadraticTo# drawQuadraticTo , -- ** faceBuilderAddTable #method:faceBuilderAddTable# faceBuilderAddTable , -- ** faceBuilderCreate #method:faceBuilderCreate# faceBuilderCreate , -- ** faceBuilderSortTables #method:faceBuilderSortTables# faceBuilderSortTables , -- ** faceCount #method:faceCount# faceCount , -- ** faceCreate #method:faceCreate# faceCreate , -- ** faceCreateFromFileOrFail #method:faceCreateFromFileOrFail# faceCreateFromFileOrFail , -- ** faceCreateFromFileOrFailUsing #method:faceCreateFromFileOrFailUsing# faceCreateFromFileOrFailUsing , -- ** faceCreateOrFail #method:faceCreateOrFail# faceCreateOrFail , -- ** faceCreateOrFailUsing #method:faceCreateOrFailUsing# faceCreateOrFailUsing , -- ** faceGetEmpty #method:faceGetEmpty# faceGetEmpty , -- ** faceGetGlyphCount #method:faceGetGlyphCount# faceGetGlyphCount , -- ** faceGetIndex #method:faceGetIndex# faceGetIndex , -- ** faceGetTableTags #method:faceGetTableTags# faceGetTableTags , -- ** faceGetUpem #method:faceGetUpem# faceGetUpem , -- ** faceIsImmutable #method:faceIsImmutable# faceIsImmutable , -- ** faceListLoaders #method:faceListLoaders# faceListLoaders , -- ** faceMakeImmutable #method:faceMakeImmutable# faceMakeImmutable , -- ** faceReferenceBlob #method:faceReferenceBlob# faceReferenceBlob , -- ** faceReferenceTable #method:faceReferenceTable# faceReferenceTable , -- ** faceSetGlyphCount #method:faceSetGlyphCount# faceSetGlyphCount , -- ** faceSetIndex #method:faceSetIndex# faceSetIndex , -- ** faceSetUpem #method:faceSetUpem# faceSetUpem , -- ** featureFromString #method:featureFromString# featureFromString , -- ** featureToString #method:featureToString# featureToString , -- ** fontAddGlyphOriginForDirection #method:fontAddGlyphOriginForDirection# fontAddGlyphOriginForDirection , -- ** fontChanged #method:fontChanged# fontChanged , -- ** fontCreate #method:fontCreate# fontCreate , -- ** fontCreateSubFont #method:fontCreateSubFont# fontCreateSubFont , -- ** fontDrawGlyph #method:fontDrawGlyph# fontDrawGlyph , -- ** fontDrawGlyphOrFail #method:fontDrawGlyphOrFail# fontDrawGlyphOrFail , -- ** fontFuncsCreate #method:fontFuncsCreate# fontFuncsCreate , -- ** fontFuncsGetEmpty #method:fontFuncsGetEmpty# fontFuncsGetEmpty , -- ** fontFuncsIsImmutable #method:fontFuncsIsImmutable# fontFuncsIsImmutable , -- ** fontFuncsMakeImmutable #method:fontFuncsMakeImmutable# fontFuncsMakeImmutable , -- ** fontGetEmpty #method:fontGetEmpty# fontGetEmpty , -- ** fontGetExtentsForDirection #method:fontGetExtentsForDirection# fontGetExtentsForDirection , -- ** fontGetFace #method:fontGetFace# fontGetFace , -- ** fontGetGlyph #method:fontGetGlyph# fontGetGlyph , -- ** fontGetGlyphAdvanceForDirection #method:fontGetGlyphAdvanceForDirection# fontGetGlyphAdvanceForDirection , -- ** fontGetGlyphAdvancesForDirection #method:fontGetGlyphAdvancesForDirection# fontGetGlyphAdvancesForDirection , -- ** fontGetGlyphContourPoint #method:fontGetGlyphContourPoint# fontGetGlyphContourPoint , -- ** fontGetGlyphContourPointForOrigin #method:fontGetGlyphContourPointForOrigin# fontGetGlyphContourPointForOrigin , -- ** fontGetGlyphExtents #method:fontGetGlyphExtents# fontGetGlyphExtents , -- ** fontGetGlyphExtentsForOrigin #method:fontGetGlyphExtentsForOrigin# fontGetGlyphExtentsForOrigin , -- ** fontGetGlyphFromName #method:fontGetGlyphFromName# fontGetGlyphFromName , -- ** fontGetGlyphHAdvance #method:fontGetGlyphHAdvance# fontGetGlyphHAdvance , -- ** fontGetGlyphHAdvances #method:fontGetGlyphHAdvances# fontGetGlyphHAdvances , -- ** fontGetGlyphHKerning #method:fontGetGlyphHKerning# fontGetGlyphHKerning , -- ** fontGetGlyphHOrigin #method:fontGetGlyphHOrigin# fontGetGlyphHOrigin , -- ** fontGetGlyphHOrigins #method:fontGetGlyphHOrigins# fontGetGlyphHOrigins , -- ** fontGetGlyphKerningForDirection #method:fontGetGlyphKerningForDirection# fontGetGlyphKerningForDirection , -- ** fontGetGlyphName #method:fontGetGlyphName# fontGetGlyphName , -- ** fontGetGlyphOriginForDirection #method:fontGetGlyphOriginForDirection# fontGetGlyphOriginForDirection , -- ** fontGetGlyphShape #method:fontGetGlyphShape# fontGetGlyphShape , -- ** fontGetGlyphVAdvance #method:fontGetGlyphVAdvance# fontGetGlyphVAdvance , -- ** fontGetGlyphVAdvances #method:fontGetGlyphVAdvances# fontGetGlyphVAdvances , -- ** fontGetGlyphVKerning #method:fontGetGlyphVKerning# fontGetGlyphVKerning , -- ** fontGetGlyphVOrigin #method:fontGetGlyphVOrigin# fontGetGlyphVOrigin , -- ** fontGetGlyphVOrigins #method:fontGetGlyphVOrigins# fontGetGlyphVOrigins , -- ** fontGetHExtents #method:fontGetHExtents# fontGetHExtents , -- ** fontGetNominalGlyph #method:fontGetNominalGlyph# fontGetNominalGlyph , -- ** fontGetNominalGlyphs #method:fontGetNominalGlyphs# fontGetNominalGlyphs , -- ** fontGetParent #method:fontGetParent# fontGetParent , -- ** fontGetPpem #method:fontGetPpem# fontGetPpem , -- ** fontGetPtem #method:fontGetPtem# fontGetPtem , -- ** fontGetScale #method:fontGetScale# fontGetScale , -- ** fontGetSerial #method:fontGetSerial# fontGetSerial , -- ** fontGetSyntheticBold #method:fontGetSyntheticBold# fontGetSyntheticBold , -- ** fontGetSyntheticSlant #method:fontGetSyntheticSlant# fontGetSyntheticSlant , -- ** fontGetVExtents #method:fontGetVExtents# fontGetVExtents , -- ** fontGetVarCoordsDesign #method:fontGetVarCoordsDesign# fontGetVarCoordsDesign , -- ** fontGetVarCoordsNormalized #method:fontGetVarCoordsNormalized# fontGetVarCoordsNormalized , -- ** fontGetVarNamedInstance #method:fontGetVarNamedInstance# fontGetVarNamedInstance , -- ** fontGetVariationGlyph #method:fontGetVariationGlyph# fontGetVariationGlyph , -- ** fontGlyphFromString #method:fontGlyphFromString# fontGlyphFromString , -- ** fontGlyphToString #method:fontGlyphToString# fontGlyphToString , -- ** fontIsImmutable #method:fontIsImmutable# fontIsImmutable , -- ** fontIsSynthetic #method:fontIsSynthetic# fontIsSynthetic , -- ** fontListFuncs #method:fontListFuncs# fontListFuncs , -- ** fontMakeImmutable #method:fontMakeImmutable# fontMakeImmutable , -- ** fontPaintGlyph #method:fontPaintGlyph# fontPaintGlyph , -- ** fontPaintGlyphOrFail #method:fontPaintGlyphOrFail# fontPaintGlyphOrFail , -- ** fontSetFace #method:fontSetFace# fontSetFace , -- ** fontSetFuncsUsing #method:fontSetFuncsUsing# fontSetFuncsUsing , -- ** fontSetParent #method:fontSetParent# fontSetParent , -- ** fontSetPpem #method:fontSetPpem# fontSetPpem , -- ** fontSetPtem #method:fontSetPtem# fontSetPtem , -- ** fontSetScale #method:fontSetScale# fontSetScale , -- ** fontSetSyntheticBold #method:fontSetSyntheticBold# fontSetSyntheticBold , -- ** fontSetSyntheticSlant #method:fontSetSyntheticSlant# fontSetSyntheticSlant , -- ** fontSetVarCoordsDesign #method:fontSetVarCoordsDesign# fontSetVarCoordsDesign , -- ** fontSetVarCoordsNormalized #method:fontSetVarCoordsNormalized# fontSetVarCoordsNormalized , -- ** fontSetVarNamedInstance #method:fontSetVarNamedInstance# fontSetVarNamedInstance , -- ** fontSetVariation #method:fontSetVariation# fontSetVariation , -- ** fontSetVariations #method:fontSetVariations# fontSetVariations , -- ** fontSubtractGlyphOriginForDirection #method:fontSubtractGlyphOriginForDirection# fontSubtractGlyphOriginForDirection , -- ** free #method:free# free , -- ** ftFaceCreateCached #method:ftFaceCreateCached# ftFaceCreateCached , -- ** ftFaceCreateFromBlobOrFail #method:ftFaceCreateFromBlobOrFail# ftFaceCreateFromBlobOrFail , -- ** ftFaceCreateFromFileOrFail #method:ftFaceCreateFromFileOrFail# ftFaceCreateFromFileOrFail , -- ** ftFaceCreateReferenced #method:ftFaceCreateReferenced# ftFaceCreateReferenced , -- ** ftFontChanged #method:ftFontChanged# ftFontChanged , -- ** ftFontCreateReferenced #method:ftFontCreateReferenced# ftFontCreateReferenced , -- ** ftFontGetLoadFlags #method:ftFontGetLoadFlags# ftFontGetLoadFlags , -- ** ftFontSetFuncs #method:ftFontSetFuncs# ftFontSetFuncs , -- ** ftFontSetLoadFlags #method:ftFontSetLoadFlags# ftFontSetLoadFlags , -- ** ftHbFontChanged #method:ftHbFontChanged# ftHbFontChanged , -- ** glibBlobCreate #method:glibBlobCreate# glibBlobCreate , -- ** glibGetUnicodeFuncs #method:glibGetUnicodeFuncs# glibGetUnicodeFuncs , -- ** glibScriptFromScript #method:glibScriptFromScript# glibScriptFromScript , -- ** glibScriptToScript #method:glibScriptToScript# glibScriptToScript , -- ** glyphInfoGetGlyphFlags #method:glyphInfoGetGlyphFlags# glyphInfoGetGlyphFlags , -- ** languageFromString #method:languageFromString# languageFromString , -- ** languageGetDefault #method:languageGetDefault# languageGetDefault , -- ** languageMatches #method:languageMatches# languageMatches , -- ** languageToString #method:languageToString# languageToString , -- ** malloc #method:malloc# malloc , -- ** mapAllocationSuccessful #method:mapAllocationSuccessful# mapAllocationSuccessful , -- ** mapClear #method:mapClear# mapClear , -- ** mapCopy #method:mapCopy# mapCopy , -- ** mapCreate #method:mapCreate# mapCreate , -- ** mapDel #method:mapDel# mapDel , -- ** mapGet #method:mapGet# mapGet , -- ** mapGetEmpty #method:mapGetEmpty# mapGetEmpty , -- ** mapGetPopulation #method:mapGetPopulation# mapGetPopulation , -- ** mapHas #method:mapHas# mapHas , -- ** mapHash #method:mapHash# mapHash , -- ** mapIsEmpty #method:mapIsEmpty# mapIsEmpty , -- ** mapIsEqual #method:mapIsEqual# mapIsEqual , -- ** mapKeys #method:mapKeys# mapKeys , -- ** mapNext #method:mapNext# mapNext , -- ** mapSet #method:mapSet# mapSet , -- ** mapUpdate #method:mapUpdate# mapUpdate , -- ** mapValues #method:mapValues# mapValues , -- ** otColorGlyphGetLayers #method:otColorGlyphGetLayers# otColorGlyphGetLayers , -- ** otColorGlyphHasPaint #method:otColorGlyphHasPaint# otColorGlyphHasPaint , -- ** otColorGlyphReferencePng #method:otColorGlyphReferencePng# otColorGlyphReferencePng , -- ** otColorGlyphReferenceSvg #method:otColorGlyphReferenceSvg# otColorGlyphReferenceSvg , -- ** otColorHasLayers #method:otColorHasLayers# otColorHasLayers , -- ** otColorHasPaint #method:otColorHasPaint# otColorHasPaint , -- ** otColorHasPalettes #method:otColorHasPalettes# otColorHasPalettes , -- ** otColorHasPng #method:otColorHasPng# otColorHasPng , -- ** otColorHasSvg #method:otColorHasSvg# otColorHasSvg , -- ** otColorPaletteColorGetNameId #method:otColorPaletteColorGetNameId# otColorPaletteColorGetNameId , -- ** otColorPaletteGetColors #method:otColorPaletteGetColors# otColorPaletteGetColors , -- ** otColorPaletteGetCount #method:otColorPaletteGetCount# otColorPaletteGetCount , -- ** otColorPaletteGetFlags #method:otColorPaletteGetFlags# otColorPaletteGetFlags , -- ** otColorPaletteGetNameId #method:otColorPaletteGetNameId# otColorPaletteGetNameId , -- ** otFontSetFuncs #method:otFontSetFuncs# otFontSetFuncs , -- ** otLayoutFeatureGetCharacters #method:otLayoutFeatureGetCharacters# otLayoutFeatureGetCharacters , -- ** otLayoutFeatureGetLookups #method:otLayoutFeatureGetLookups# otLayoutFeatureGetLookups , -- ** otLayoutFeatureGetNameIds #method:otLayoutFeatureGetNameIds# otLayoutFeatureGetNameIds , -- ** otLayoutFeatureWithVariationsGetLookups #method:otLayoutFeatureWithVariationsGetLookups# otLayoutFeatureWithVariationsGetLookups , -- ** otLayoutGetAttachPoints #method:otLayoutGetAttachPoints# otLayoutGetAttachPoints , -- ** otLayoutGetBaseline #method:otLayoutGetBaseline# otLayoutGetBaseline , -- ** otLayoutGetBaseline2 #method:otLayoutGetBaseline2# otLayoutGetBaseline2 , -- ** otLayoutGetBaselineWithFallback #method:otLayoutGetBaselineWithFallback# otLayoutGetBaselineWithFallback , -- ** otLayoutGetBaselineWithFallback2 #method:otLayoutGetBaselineWithFallback2# otLayoutGetBaselineWithFallback2 , -- ** otLayoutGetFontExtents #method:otLayoutGetFontExtents# otLayoutGetFontExtents , -- ** otLayoutGetFontExtents2 #method:otLayoutGetFontExtents2# otLayoutGetFontExtents2 , -- ** otLayoutGetGlyphClass #method:otLayoutGetGlyphClass# otLayoutGetGlyphClass , -- ** otLayoutGetHorizontalBaselineTagForScript #method:otLayoutGetHorizontalBaselineTagForScript# otLayoutGetHorizontalBaselineTagForScript, -- ** otLayoutGetLigatureCarets #method:otLayoutGetLigatureCarets# otLayoutGetLigatureCarets , -- ** otLayoutGetSizeParams #method:otLayoutGetSizeParams# otLayoutGetSizeParams , -- ** otLayoutHasGlyphClasses #method:otLayoutHasGlyphClasses# otLayoutHasGlyphClasses , -- ** otLayoutHasPositioning #method:otLayoutHasPositioning# otLayoutHasPositioning , -- ** otLayoutHasSubstitution #method:otLayoutHasSubstitution# otLayoutHasSubstitution , -- ** otLayoutLanguageFindFeature #method:otLayoutLanguageFindFeature# otLayoutLanguageFindFeature , -- ** otLayoutLanguageGetFeatureIndexes #method:otLayoutLanguageGetFeatureIndexes# otLayoutLanguageGetFeatureIndexes , -- ** otLayoutLanguageGetFeatureTags #method:otLayoutLanguageGetFeatureTags# otLayoutLanguageGetFeatureTags , -- ** otLayoutLanguageGetRequiredFeature #method:otLayoutLanguageGetRequiredFeature# otLayoutLanguageGetRequiredFeature , -- ** otLayoutLanguageGetRequiredFeatureIndex #method:otLayoutLanguageGetRequiredFeatureIndex# otLayoutLanguageGetRequiredFeatureIndex , -- ** otLayoutLookupGetGlyphAlternates #method:otLayoutLookupGetGlyphAlternates# otLayoutLookupGetGlyphAlternates , -- ** otLayoutLookupGetOpticalBound #method:otLayoutLookupGetOpticalBound# otLayoutLookupGetOpticalBound , -- ** otLayoutLookupWouldSubstitute #method:otLayoutLookupWouldSubstitute# otLayoutLookupWouldSubstitute , -- ** otLayoutScriptFindLanguage #method:otLayoutScriptFindLanguage# otLayoutScriptFindLanguage , -- ** otLayoutScriptGetLanguageTags #method:otLayoutScriptGetLanguageTags# otLayoutScriptGetLanguageTags , -- ** otLayoutScriptSelectLanguage #method:otLayoutScriptSelectLanguage# otLayoutScriptSelectLanguage , -- ** otLayoutScriptSelectLanguage2 #method:otLayoutScriptSelectLanguage2# otLayoutScriptSelectLanguage2 , -- ** otLayoutTableChooseScript #method:otLayoutTableChooseScript# otLayoutTableChooseScript , -- ** otLayoutTableFindFeatureVariations #method:otLayoutTableFindFeatureVariations# otLayoutTableFindFeatureVariations , -- ** otLayoutTableFindScript #method:otLayoutTableFindScript# otLayoutTableFindScript , -- ** otLayoutTableGetFeatureTags #method:otLayoutTableGetFeatureTags# otLayoutTableGetFeatureTags , -- ** otLayoutTableGetLookupCount #method:otLayoutTableGetLookupCount# otLayoutTableGetLookupCount , -- ** otLayoutTableGetScriptTags #method:otLayoutTableGetScriptTags# otLayoutTableGetScriptTags , -- ** otLayoutTableSelectScript #method:otLayoutTableSelectScript# otLayoutTableSelectScript , -- ** otMathGetConstant #method:otMathGetConstant# otMathGetConstant , -- ** otMathGetGlyphAssembly #method:otMathGetGlyphAssembly# otMathGetGlyphAssembly , -- ** otMathGetGlyphItalicsCorrection #method:otMathGetGlyphItalicsCorrection# otMathGetGlyphItalicsCorrection , -- ** otMathGetGlyphKerning #method:otMathGetGlyphKerning# otMathGetGlyphKerning , -- ** otMathGetGlyphKernings #method:otMathGetGlyphKernings# otMathGetGlyphKernings , -- ** otMathGetGlyphTopAccentAttachment #method:otMathGetGlyphTopAccentAttachment# otMathGetGlyphTopAccentAttachment , -- ** otMathGetGlyphVariants #method:otMathGetGlyphVariants# otMathGetGlyphVariants , -- ** otMathGetMinConnectorOverlap #method:otMathGetMinConnectorOverlap# otMathGetMinConnectorOverlap , -- ** otMathHasData #method:otMathHasData# otMathHasData , -- ** otMathIsGlyphExtendedShape #method:otMathIsGlyphExtendedShape# otMathIsGlyphExtendedShape , -- ** otMetaGetEntryTags #method:otMetaGetEntryTags# otMetaGetEntryTags , -- ** otMetaReferenceEntry #method:otMetaReferenceEntry# otMetaReferenceEntry , -- ** otMetricsGetPosition #method:otMetricsGetPosition# otMetricsGetPosition , -- ** otMetricsGetPositionWithFallback #method:otMetricsGetPositionWithFallback# otMetricsGetPositionWithFallback , -- ** otMetricsGetVariation #method:otMetricsGetVariation# otMetricsGetVariation , -- ** otMetricsGetXVariation #method:otMetricsGetXVariation# otMetricsGetXVariation , -- ** otMetricsGetYVariation #method:otMetricsGetYVariation# otMetricsGetYVariation , -- ** otNameGetUtf16 #method:otNameGetUtf16# otNameGetUtf16 , -- ** otNameGetUtf32 #method:otNameGetUtf32# otNameGetUtf32 , -- ** otNameGetUtf8 #method:otNameGetUtf8# otNameGetUtf8 , -- ** otNameListNames #method:otNameListNames# otNameListNames , -- ** otShapePlanGetFeatureTags #method:otShapePlanGetFeatureTags# otShapePlanGetFeatureTags , -- ** otTagFromLanguage #method:otTagFromLanguage# otTagFromLanguage , -- ** otTagToLanguage #method:otTagToLanguage# otTagToLanguage , -- ** otTagToScript #method:otTagToScript# otTagToScript , -- ** otTagsFromScript #method:otTagsFromScript# otTagsFromScript , -- ** otTagsFromScriptAndLanguage #method:otTagsFromScriptAndLanguage# otTagsFromScriptAndLanguage , -- ** otVarFindAxis #method:otVarFindAxis# otVarFindAxis , -- ** otVarFindAxisInfo #method:otVarFindAxisInfo# otVarFindAxisInfo , -- ** otVarGetAxes #method:otVarGetAxes# otVarGetAxes , -- ** otVarGetAxisCount #method:otVarGetAxisCount# otVarGetAxisCount , -- ** otVarGetAxisInfos #method:otVarGetAxisInfos# otVarGetAxisInfos , -- ** otVarGetNamedInstanceCount #method:otVarGetNamedInstanceCount# otVarGetNamedInstanceCount , -- ** otVarHasData #method:otVarHasData# otVarHasData , -- ** otVarNamedInstanceGetDesignCoords #method:otVarNamedInstanceGetDesignCoords# otVarNamedInstanceGetDesignCoords , -- ** otVarNamedInstanceGetPostscriptNameId #method:otVarNamedInstanceGetPostscriptNameId# otVarNamedInstanceGetPostscriptNameId , -- ** otVarNamedInstanceGetSubfamilyNameId #method:otVarNamedInstanceGetSubfamilyNameId# otVarNamedInstanceGetSubfamilyNameId , -- ** otVarNormalizeCoords #method:otVarNormalizeCoords# otVarNormalizeCoords , -- ** otVarNormalizeVariations #method:otVarNormalizeVariations# otVarNormalizeVariations , -- ** paintColor #method:paintColor# paintColor , -- ** paintColorGlyph #method:paintColorGlyph# paintColorGlyph , -- ** paintCustomPaletteColor #method:paintCustomPaletteColor# paintCustomPaletteColor , -- ** paintFuncsCreate #method:paintFuncsCreate# paintFuncsCreate , -- ** paintFuncsGetEmpty #method:paintFuncsGetEmpty# paintFuncsGetEmpty , -- ** paintFuncsIsImmutable #method:paintFuncsIsImmutable# paintFuncsIsImmutable , -- ** paintFuncsMakeImmutable #method:paintFuncsMakeImmutable# paintFuncsMakeImmutable , -- ** paintImage #method:paintImage# paintImage , -- ** paintLinearGradient #method:paintLinearGradient# paintLinearGradient , -- ** paintPopClip #method:paintPopClip# paintPopClip , -- ** paintPopGroup #method:paintPopGroup# paintPopGroup , -- ** paintPopTransform #method:paintPopTransform# paintPopTransform , -- ** paintPushClipGlyph #method:paintPushClipGlyph# paintPushClipGlyph , -- ** paintPushClipRectangle #method:paintPushClipRectangle# paintPushClipRectangle , -- ** paintPushFontTransform #method:paintPushFontTransform# paintPushFontTransform , -- ** paintPushGroup #method:paintPushGroup# paintPushGroup , -- ** paintPushInverseFontTransform #method:paintPushInverseFontTransform# paintPushInverseFontTransform , -- ** paintPushTransform #method:paintPushTransform# paintPushTransform , -- ** paintRadialGradient #method:paintRadialGradient# paintRadialGradient , -- ** paintSweepGradient #method:paintSweepGradient# paintSweepGradient , -- ** realloc #method:realloc# realloc , -- ** scriptFromIso15924Tag #method:scriptFromIso15924Tag# scriptFromIso15924Tag , -- ** scriptFromString #method:scriptFromString# scriptFromString , -- ** scriptGetHorizontalDirection #method:scriptGetHorizontalDirection# scriptGetHorizontalDirection , -- ** scriptToIso15924Tag #method:scriptToIso15924Tag# scriptToIso15924Tag , -- ** segmentPropertiesEqual #method:segmentPropertiesEqual# segmentPropertiesEqual , -- ** segmentPropertiesHash #method:segmentPropertiesHash# segmentPropertiesHash , -- ** segmentPropertiesOverlay #method:segmentPropertiesOverlay# segmentPropertiesOverlay , -- ** setAdd #method:setAdd# setAdd , -- ** setAddRange #method:setAddRange# setAddRange , -- ** setAddSortedArray #method:setAddSortedArray# setAddSortedArray , -- ** setAllocationSuccessful #method:setAllocationSuccessful# setAllocationSuccessful , -- ** setClear #method:setClear# setClear , -- ** setCopy #method:setCopy# setCopy , -- ** setCreate #method:setCreate# setCreate , -- ** setDel #method:setDel# setDel , -- ** setDelRange #method:setDelRange# setDelRange , -- ** setGetEmpty #method:setGetEmpty# setGetEmpty , -- ** setGetMax #method:setGetMax# setGetMax , -- ** setGetMin #method:setGetMin# setGetMin , -- ** setGetPopulation #method:setGetPopulation# setGetPopulation , -- ** setHas #method:setHas# setHas , -- ** setHash #method:setHash# setHash , -- ** setIntersect #method:setIntersect# setIntersect , -- ** setInvert #method:setInvert# setInvert , -- ** setIsEmpty #method:setIsEmpty# setIsEmpty , -- ** setIsEqual #method:setIsEqual# setIsEqual , -- ** setIsInverted #method:setIsInverted# setIsInverted , -- ** setIsSubset #method:setIsSubset# setIsSubset , -- ** setNext #method:setNext# setNext , -- ** setNextMany #method:setNextMany# setNextMany , -- ** setNextRange #method:setNextRange# setNextRange , -- ** setPrevious #method:setPrevious# setPrevious , -- ** setPreviousRange #method:setPreviousRange# setPreviousRange , -- ** setSet #method:setSet# setSet , -- ** setSubtract #method:setSubtract# setSubtract , -- ** setSymmetricDifference #method:setSymmetricDifference# setSymmetricDifference , -- ** setUnion #method:setUnion# setUnion , -- ** shape #method:shape# shape , -- ** shapeFull #method:shapeFull# shapeFull , -- ** shapeListShapers #method:shapeListShapers# shapeListShapers , -- ** shapePlanCreate #method:shapePlanCreate# shapePlanCreate , -- ** shapePlanCreate2 #method:shapePlanCreate2# shapePlanCreate2 , -- ** shapePlanCreateCached #method:shapePlanCreateCached# shapePlanCreateCached , -- ** shapePlanCreateCached2 #method:shapePlanCreateCached2# shapePlanCreateCached2 , -- ** shapePlanExecute #method:shapePlanExecute# shapePlanExecute , -- ** shapePlanGetEmpty #method:shapePlanGetEmpty# shapePlanGetEmpty , -- ** shapePlanGetShaper #method:shapePlanGetShaper# shapePlanGetShaper , -- ** styleGetValue #method:styleGetValue# styleGetValue , -- ** tagFromString #method:tagFromString# tagFromString , -- ** unicodeCombiningClass #method:unicodeCombiningClass# unicodeCombiningClass , -- ** unicodeCompose #method:unicodeCompose# unicodeCompose , -- ** unicodeDecompose #method:unicodeDecompose# unicodeDecompose , -- ** unicodeDecomposeCompatibility #method:unicodeDecomposeCompatibility# unicodeDecomposeCompatibility , -- ** unicodeEastasianWidth #method:unicodeEastasianWidth# unicodeEastasianWidth , -- ** unicodeFuncsCreate #method:unicodeFuncsCreate# unicodeFuncsCreate , -- ** unicodeFuncsGetDefault #method:unicodeFuncsGetDefault# unicodeFuncsGetDefault , -- ** unicodeFuncsGetEmpty #method:unicodeFuncsGetEmpty# unicodeFuncsGetEmpty , -- ** unicodeFuncsGetParent #method:unicodeFuncsGetParent# unicodeFuncsGetParent , -- ** unicodeFuncsIsImmutable #method:unicodeFuncsIsImmutable# unicodeFuncsIsImmutable , -- ** unicodeFuncsMakeImmutable #method:unicodeFuncsMakeImmutable# unicodeFuncsMakeImmutable , -- ** unicodeGeneralCategory #method:unicodeGeneralCategory# unicodeGeneralCategory , -- ** unicodeMirroring #method:unicodeMirroring# unicodeMirroring , -- ** unicodeScript #method:unicodeScript# unicodeScript , -- ** variationFromString #method:variationFromString# variationFromString , -- ** variationToString #method:variationToString# variationToString , ) where import Data.GI.Base.ShortPrelude import qualified Data.GI.Base.ShortPrelude as SP import qualified Data.GI.Base.Overloading as O import qualified Prelude as P import qualified Data.GI.Base.Attributes as GI.Attributes import qualified Data.GI.Base.BasicTypes as B.Types import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr import qualified Data.GI.Base.GArray as B.GArray import qualified Data.GI.Base.GClosure as B.GClosure import qualified Data.GI.Base.GError as B.GError import qualified Data.GI.Base.GHashTable as B.GHT import qualified Data.GI.Base.GVariant as B.GVariant import qualified Data.GI.Base.GValue as B.GValue import qualified Data.GI.Base.GParamSpec as B.GParamSpec import qualified Data.GI.Base.CallStack as B.CallStack import qualified Data.GI.Base.Properties as B.Properties import qualified Data.GI.Base.Signals as B.Signals import qualified Control.Monad.IO.Class as MIO import qualified Data.Coerce as Coerce import qualified Data.Text as T import qualified Data.Kind as DK import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import qualified Foreign.Ptr as FP import qualified GHC.OverloadedLabels as OL import qualified GHC.Records as R import qualified Data.Word as DW import qualified Data.Int as DI import qualified System.Posix.Types as SPT import qualified Foreign.C.Types as FCT -- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392 #if MIN_VERSION_base(4,18,0) import qualified GI.Freetype2.Structs.Face as Freetype2.Face import qualified GI.GLib.Enums as GLib.Enums import qualified GI.GLib.Structs.Bytes as GLib.Bytes import qualified GI.HarfBuzz.Callbacks as HarfBuzz.Callbacks import {-# SOURCE #-} qualified GI.HarfBuzz.Enums as HarfBuzz.Enums import {-# SOURCE #-} qualified GI.HarfBuzz.Flags as HarfBuzz.Flags import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.AatLayoutFeatureSelectorInfoT as HarfBuzz.AatLayoutFeatureSelectorInfoT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.BlobT as HarfBuzz.BlobT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.BufferT as HarfBuzz.BufferT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.ColorLineT as HarfBuzz.ColorLineT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.ColorStopT as HarfBuzz.ColorStopT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.DrawFuncsT as HarfBuzz.DrawFuncsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.DrawStateT as HarfBuzz.DrawStateT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FaceT as HarfBuzz.FaceT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FeatureT as HarfBuzz.FeatureT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FontExtentsT as HarfBuzz.FontExtentsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FontFuncsT as HarfBuzz.FontFuncsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FontT as HarfBuzz.FontT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.GlyphExtentsT as HarfBuzz.GlyphExtentsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.GlyphInfoT as HarfBuzz.GlyphInfoT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.GlyphPositionT as HarfBuzz.GlyphPositionT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.LanguageT as HarfBuzz.LanguageT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.MapT as HarfBuzz.MapT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtColorLayerT as HarfBuzz.OtColorLayerT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtMathGlyphPartT as HarfBuzz.OtMathGlyphPartT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtMathGlyphVariantT as HarfBuzz.OtMathGlyphVariantT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtMathKernEntryT as HarfBuzz.OtMathKernEntryT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtNameEntryT as HarfBuzz.OtNameEntryT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtVarAxisInfoT as HarfBuzz.OtVarAxisInfoT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtVarAxisT as HarfBuzz.OtVarAxisT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.PaintFuncsT as HarfBuzz.PaintFuncsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.SegmentPropertiesT as HarfBuzz.SegmentPropertiesT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.SetT as HarfBuzz.SetT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.ShapePlanT as HarfBuzz.ShapePlanT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.UnicodeFuncsT as HarfBuzz.UnicodeFuncsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.VariationT as HarfBuzz.VariationT #else import qualified GI.Freetype2.Structs.Face as Freetype2.Face import qualified GI.GLib.Enums as GLib.Enums import qualified GI.GLib.Structs.Bytes as GLib.Bytes import {-# SOURCE #-} qualified GI.HarfBuzz.Enums as HarfBuzz.Enums import {-# SOURCE #-} qualified GI.HarfBuzz.Flags as HarfBuzz.Flags import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.AatLayoutFeatureSelectorInfoT as HarfBuzz.AatLayoutFeatureSelectorInfoT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.BlobT as HarfBuzz.BlobT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.BufferT as HarfBuzz.BufferT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.ColorLineT as HarfBuzz.ColorLineT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.ColorStopT as HarfBuzz.ColorStopT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.DrawFuncsT as HarfBuzz.DrawFuncsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.DrawStateT as HarfBuzz.DrawStateT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FaceT as HarfBuzz.FaceT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FeatureT as HarfBuzz.FeatureT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FontExtentsT as HarfBuzz.FontExtentsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FontFuncsT as HarfBuzz.FontFuncsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FontT as HarfBuzz.FontT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.GlyphExtentsT as HarfBuzz.GlyphExtentsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.GlyphInfoT as HarfBuzz.GlyphInfoT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.GlyphPositionT as HarfBuzz.GlyphPositionT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.LanguageT as HarfBuzz.LanguageT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.MapT as HarfBuzz.MapT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtColorLayerT as HarfBuzz.OtColorLayerT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtMathGlyphPartT as HarfBuzz.OtMathGlyphPartT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtMathGlyphVariantT as HarfBuzz.OtMathGlyphVariantT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtMathKernEntryT as HarfBuzz.OtMathKernEntryT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtNameEntryT as HarfBuzz.OtNameEntryT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtVarAxisInfoT as HarfBuzz.OtVarAxisInfoT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtVarAxisT as HarfBuzz.OtVarAxisT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.PaintFuncsT as HarfBuzz.PaintFuncsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.SegmentPropertiesT as HarfBuzz.SegmentPropertiesT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.SetT as HarfBuzz.SetT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.ShapePlanT as HarfBuzz.ShapePlanT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.UnicodeFuncsT as HarfBuzz.UnicodeFuncsT import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.VariationT as HarfBuzz.VariationT #endif -- function variation_to_string -- Args: [ Arg -- { argCName = "variation" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "variation_t" } -- , argCType = Just "hb_variation_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_variation_t to convert" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buf" -- , argType = TCArray False (-1) 2 (TBasicType TUTF8) -- , argCType = Just "char*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "output string" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the allocated size of @buf" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the allocated size of @buf" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_variation_to_string" hb_variation_to_string :: Ptr HarfBuzz.VariationT.VariationT -> -- variation : TInterface (Name {namespace = "HarfBuzz", name = "variation_t"}) Ptr CString -> -- buf : TCArray False (-1) 2 (TBasicType TUTF8) Word32 -> -- size : TBasicType TUInt IO () -- | Converts an t'GI.HarfBuzz.Structs.VariationT.VariationT' into a @NULL@-terminated string in the format -- understood by 'GI.HarfBuzz.Functions.variationFromString'. The client in responsible for -- allocating big enough size for /@buf@/, 128 bytes is more than enough. -- -- Note that the string won\'t include any whitespace. -- -- /Since: 1.4.2/ variationToString :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.VariationT.VariationT -- ^ /@variation@/: an t'GI.HarfBuzz.Structs.VariationT.VariationT' to convert -> [T.Text] -- ^ /@buf@/: output string -> m ([T.Text]) variationToString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => VariationT -> [Text] -> m [Text] variationToString VariationT variation [Text] buf = IO [Text] -> m [Text] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text] forall a b. (a -> b) -> a -> b $ do let size :: Word32 size = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Text] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Text] buf variation' <- VariationT -> IO (Ptr VariationT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr VariationT variation buf' <- packUTF8CArray buf hb_variation_to_string variation' buf' size buf'' <- (unpackUTF8CArrayWithLength size) buf' (mapCArrayWithLength size) freeMem buf' freeMem buf' touchManagedPtr variation return buf'' -- function variation_from_string -- Args: [ Arg -- { argCName = "str" -- , argType = TCArray False (-1) 1 (TBasicType TUInt8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a string to parse" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "length of @str, or -1 if string is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "variation" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "variation_t" } -- , argCType = Just "hb_variation_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the #hb_variation_t to initialize with the parsed values" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "length of @str, or -1 if string is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_variation_from_string" hb_variation_from_string :: Ptr Word8 -> -- str : TCArray False (-1) 1 (TBasicType TUInt8) Int32 -> -- len : TBasicType TInt Ptr HarfBuzz.VariationT.VariationT -> -- variation : TInterface (Name {namespace = "HarfBuzz", name = "variation_t"}) IO Int32 -- | Parses a string into a t'GI.HarfBuzz.Structs.VariationT.VariationT'. -- -- The format for specifying variation settings follows. All valid CSS -- font-variation-settings values other than \'normal\' and \'inherited\' are also -- accepted, though, not documented below. -- -- The format is a tag, optionally followed by an equals sign, followed by a -- number. For example @wght=500@, or @slnt=-7.5@. -- -- /Since: 1.4.2/ variationFromString :: (B.CallStack.HasCallStack, MonadIO m) => ByteString -- ^ /@str@/: a string to parse -> m ((Int32, HarfBuzz.VariationT.VariationT)) -- ^ __Returns:__ @true@ if /@str@/ is successfully parsed, @false@ otherwise variationFromString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ByteString -> m (Int32, VariationT) variationFromString ByteString str = IO (Int32, VariationT) -> m (Int32, VariationT) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, VariationT) -> m (Int32, VariationT)) -> IO (Int32, VariationT) -> m (Int32, VariationT) forall a b. (a -> b) -> a -> b $ do let len :: Int32 len = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString str str' <- ByteString -> IO (Ptr Word8) packByteString ByteString str variation <- SP.callocBytes 8 :: IO (Ptr HarfBuzz.VariationT.VariationT) result <- hb_variation_from_string str' len variation variation' <- (wrapPtr HarfBuzz.VariationT.VariationT) variation freeMem str' return (result, variation') -- function unicode_script -- Args: [ Arg -- { argCName = "ufuncs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "unicode" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "script_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_script" hb_unicode_script :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) Word32 -> -- unicode : TBasicType TUInt32 IO CUInt -- | Retrieves the t'GI.HarfBuzz.Flags.ScriptT' script to which code -- point /@unicode@/ belongs. -- -- /Since: 0.9.2/ unicodeScript :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@ufuncs@/: The Unicode-functions structure -> Word32 -- ^ /@unicode@/: The code point to query -> m [HarfBuzz.Flags.ScriptT] -- ^ __Returns:__ The t'GI.HarfBuzz.Flags.ScriptT' of /@unicode@/ unicodeScript :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeFuncsT -> Word32 -> m [ScriptT] unicodeScript UnicodeFuncsT ufuncs Word32 unicode = IO [ScriptT] -> m [ScriptT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [ScriptT] -> m [ScriptT]) -> IO [ScriptT] -> m [ScriptT] forall a b. (a -> b) -> a -> b $ do ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT ufuncs result <- hb_unicode_script ufuncs' unicode let result' = CUInt -> [ScriptT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result touchManagedPtr ufuncs return result' -- function unicode_mirroring -- Args: [ Arg -- { argCName = "ufuncs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "unicode" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_mirroring" hb_unicode_mirroring :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) Word32 -> -- unicode : TBasicType TUInt32 IO Word32 -- | Retrieves the Bi-directional Mirroring Glyph code -- point defined for code point /@unicode@/. -- -- /Since: 0.9.2/ unicodeMirroring :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@ufuncs@/: The Unicode-functions structure -> Word32 -- ^ /@unicode@/: The code point to query -> m Word32 -- ^ __Returns:__ The @/hb_codepoint_t/@ of the Mirroring Glyph for /@unicode@/ unicodeMirroring :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeFuncsT -> Word32 -> m Word32 unicodeMirroring UnicodeFuncsT ufuncs Word32 unicode = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT ufuncs result <- hb_unicode_mirroring ufuncs' unicode touchManagedPtr ufuncs return result -- function unicode_general_category -- Args: [ Arg -- { argCName = "ufuncs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "unicode" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name -- { namespace = "HarfBuzz" , name = "unicode_general_category_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_general_category" hb_unicode_general_category :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) Word32 -> -- unicode : TBasicType TUInt32 IO CUInt -- | Retrieves the General Category (gc) property -- of code point /@unicode@/. -- -- /Since: 0.9.2/ unicodeGeneralCategory :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@ufuncs@/: The Unicode-functions structure -> Word32 -- ^ /@unicode@/: The code point to query -> m HarfBuzz.Enums.UnicodeGeneralCategoryT -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.UnicodeGeneralCategoryT' of /@unicode@/ unicodeGeneralCategory :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeFuncsT -> Word32 -> m UnicodeGeneralCategoryT unicodeGeneralCategory UnicodeFuncsT ufuncs Word32 unicode = IO UnicodeGeneralCategoryT -> m UnicodeGeneralCategoryT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO UnicodeGeneralCategoryT -> m UnicodeGeneralCategoryT) -> IO UnicodeGeneralCategoryT -> m UnicodeGeneralCategoryT forall a b. (a -> b) -> a -> b $ do ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT ufuncs result <- hb_unicode_general_category ufuncs' unicode let result' = (Int -> UnicodeGeneralCategoryT forall a. Enum a => Int -> a toEnum (Int -> UnicodeGeneralCategoryT) -> (CUInt -> Int) -> CUInt -> UnicodeGeneralCategoryT forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result touchManagedPtr ufuncs return result' -- function unicode_funcs_set_script_func -- XXX Could not generate function unicode_funcs_set_script_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function unicode_funcs_set_mirroring_func -- XXX Could not generate function unicode_funcs_set_mirroring_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function unicode_funcs_set_general_category_func -- XXX Could not generate function unicode_funcs_set_general_category_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function unicode_funcs_set_eastasian_width_func -- XXX Could not generate function unicode_funcs_set_eastasian_width_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function unicode_funcs_set_decompose_func -- XXX Could not generate function unicode_funcs_set_decompose_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function unicode_funcs_set_decompose_compatibility_func -- XXX Could not generate function unicode_funcs_set_decompose_compatibility_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function unicode_funcs_set_compose_func -- XXX Could not generate function unicode_funcs_set_compose_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function unicode_funcs_set_combining_class_func -- XXX Could not generate function unicode_funcs_set_combining_class_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function unicode_funcs_make_immutable -- Args: [ Arg -- { argCName = "ufuncs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_unicode_funcs_make_immutable" hb_unicode_funcs_make_immutable :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) IO () -- | Makes the specified Unicode-functions structure -- immutable. -- -- /Since: 0.9.2/ unicodeFuncsMakeImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@ufuncs@/: The Unicode-functions structure -> m () unicodeFuncsMakeImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeFuncsT -> m () unicodeFuncsMakeImmutable UnicodeFuncsT ufuncs = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT ufuncs hb_unicode_funcs_make_immutable ufuncs' touchManagedPtr ufuncs return () -- function unicode_funcs_is_immutable -- Args: [ Arg -- { argCName = "ufuncs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_funcs_is_immutable" hb_unicode_funcs_is_immutable :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) IO Int32 -- | Tests whether the specified Unicode-functions structure -- is immutable. -- -- /Since: 0.9.2/ unicodeFuncsIsImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@ufuncs@/: The Unicode-functions structure -> m Int32 -- ^ __Returns:__ @true@ if /@ufuncs@/ is immutable, @false@ otherwise unicodeFuncsIsImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeFuncsT -> m Int32 unicodeFuncsIsImmutable UnicodeFuncsT ufuncs = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT ufuncs result <- hb_unicode_funcs_is_immutable ufuncs' touchManagedPtr ufuncs return result -- function unicode_funcs_get_parent -- Args: [ Arg -- { argCName = "ufuncs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_funcs_get_parent" hb_unicode_funcs_get_parent :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) -- | Fetches the parent of the Unicode-functions structure -- /@ufuncs@/. -- -- /Since: 0.9.2/ unicodeFuncsGetParent :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@ufuncs@/: The Unicode-functions structure -> m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ __Returns:__ The parent Unicode-functions structure unicodeFuncsGetParent :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeFuncsT -> m UnicodeFuncsT unicodeFuncsGetParent UnicodeFuncsT ufuncs = IO UnicodeFuncsT -> m UnicodeFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT) -> IO UnicodeFuncsT -> m UnicodeFuncsT forall a b. (a -> b) -> a -> b $ do ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT ufuncs result <- hb_unicode_funcs_get_parent ufuncs' checkUnexpectedReturnNULL "unicodeFuncsGetParent" result result' <- (wrapBoxed HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) result touchManagedPtr ufuncs return result' -- function unicode_funcs_get_empty -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_funcs_get_empty" hb_unicode_funcs_get_empty :: IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) -- | Fetches the singleton empty Unicode-functions structure. -- -- /Since: 0.9.2/ unicodeFuncsGetEmpty :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ __Returns:__ The empty Unicode-functions structure unicodeFuncsGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m UnicodeFuncsT unicodeFuncsGetEmpty = IO UnicodeFuncsT -> m UnicodeFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT) -> IO UnicodeFuncsT -> m UnicodeFuncsT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr UnicodeFuncsT) hb_unicode_funcs_get_empty checkUnexpectedReturnNULL "unicodeFuncsGetEmpty" result result' <- (wrapBoxed HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) result return result' -- function unicode_funcs_get_default -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_funcs_get_default" hb_unicode_funcs_get_default :: IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) -- | Fetches a pointer to the default Unicode-functions structure that is used -- when no functions are explicitly set on t'GI.HarfBuzz.Structs.BufferT.BufferT'. -- -- /Since: 0.9.2/ unicodeFuncsGetDefault :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ __Returns:__ a pointer to the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' Unicode-functions structure unicodeFuncsGetDefault :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m UnicodeFuncsT unicodeFuncsGetDefault = IO UnicodeFuncsT -> m UnicodeFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT) -> IO UnicodeFuncsT -> m UnicodeFuncsT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr UnicodeFuncsT) hb_unicode_funcs_get_default checkUnexpectedReturnNULL "unicodeFuncsGetDefault" result result' <- (newBoxed HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) result return result' -- function unicode_funcs_create -- Args: [ Arg -- { argCName = "parent" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Parent Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_funcs_create" hb_unicode_funcs_create :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- parent : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) -- | Creates a new t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure of Unicode functions. -- -- /Since: 0.9.2/ unicodeFuncsCreate :: (B.CallStack.HasCallStack, MonadIO m) => Maybe (HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) -- ^ /@parent@/: Parent Unicode-functions structure -> m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ __Returns:__ The Unicode-functions structure unicodeFuncsCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Maybe UnicodeFuncsT -> m UnicodeFuncsT unicodeFuncsCreate Maybe UnicodeFuncsT parent = IO UnicodeFuncsT -> m UnicodeFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT) -> IO UnicodeFuncsT -> m UnicodeFuncsT forall a b. (a -> b) -> a -> b $ do maybeParent <- case Maybe UnicodeFuncsT parent of Maybe UnicodeFuncsT Nothing -> Ptr UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr UnicodeFuncsT forall a. Ptr a FP.nullPtr Just UnicodeFuncsT jParent -> do jParent' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT jParent return jParent' result <- hb_unicode_funcs_create maybeParent checkUnexpectedReturnNULL "unicodeFuncsCreate" result result' <- (wrapBoxed HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) result whenJust parent touchManagedPtr return result' -- function unicode_eastasian_width -- Args: [ Arg -- { argCName = "ufuncs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a Unicode-function structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "unicode" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_eastasian_width" hb_unicode_eastasian_width :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) Word32 -> -- unicode : TBasicType TUInt32 IO Word32 {-# DEPRECATED unicodeEastasianWidth ["(Since version 2.0.0)"] #-} -- | Don\'t use. Not used by HarfBuzz. -- -- /Since: 0.9.2/ unicodeEastasianWidth :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@ufuncs@/: a Unicode-function structure -> Word32 -- ^ /@unicode@/: The code point to query -> m Word32 unicodeEastasianWidth :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeFuncsT -> Word32 -> m Word32 unicodeEastasianWidth UnicodeFuncsT ufuncs Word32 unicode = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT ufuncs result <- hb_unicode_eastasian_width ufuncs' unicode touchManagedPtr ufuncs return result -- function unicode_decompose_compatibility -- Args: [ Arg -- { argCName = "ufuncs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "u" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Code point to decompose" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "decomposed" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Compatibility decomposition of @u" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_decompose_compatibility" hb_unicode_decompose_compatibility :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) Word32 -> -- u : TBasicType TUInt32 Ptr Word32 -> -- decomposed : TBasicType TUInt32 IO Word32 {-# DEPRECATED unicodeDecomposeCompatibility ["(Since version 2.0.0)"] #-} -- | Fetches the compatibility decomposition of a Unicode -- code point. Deprecated. -- -- /Since: 0.9.2/ unicodeDecomposeCompatibility :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@ufuncs@/: The Unicode-functions structure -> Word32 -- ^ /@u@/: Code point to decompose -> m ((Word32, Word32)) -- ^ __Returns:__ length of /@decomposed@/. unicodeDecomposeCompatibility :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeFuncsT -> Word32 -> m (Word32, Word32) unicodeDecomposeCompatibility UnicodeFuncsT ufuncs Word32 u = IO (Word32, Word32) -> m (Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, Word32) -> m (Word32, Word32)) -> IO (Word32, Word32) -> m (Word32, Word32) forall a b. (a -> b) -> a -> b $ do ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT ufuncs decomposed <- allocMem :: IO (Ptr Word32) result <- hb_unicode_decompose_compatibility ufuncs' u decomposed decomposed' <- peek decomposed touchManagedPtr ufuncs freeMem decomposed return (result, decomposed') -- function unicode_decompose -- Args: [ Arg -- { argCName = "ufuncs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "ab" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Unicode code point to decompose" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "a" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The first code point of the decomposition of @ab" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "b" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The second code point of the decomposition of @ab" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_decompose" hb_unicode_decompose :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) Word32 -> -- ab : TBasicType TUInt32 Ptr Word32 -> -- a : TBasicType TUInt32 Ptr Word32 -> -- b : TBasicType TUInt32 IO Int32 -- | Fetches the decomposition of a Unicode code point. -- -- Calls the decomposition function of the specified -- Unicode-functions structure /@ufuncs@/. -- -- /Since: 0.9.2/ unicodeDecompose :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@ufuncs@/: The Unicode-functions structure -> Word32 -- ^ /@ab@/: Unicode code point to decompose -> m ((Int32, Word32, Word32)) -- ^ __Returns:__ @true@ if /@ab@/ was decomposed, @false@ otherwise unicodeDecompose :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeFuncsT -> Word32 -> m (Int32, Word32, Word32) unicodeDecompose UnicodeFuncsT ufuncs Word32 ab = IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32)) -> IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a b. (a -> b) -> a -> b $ do ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT ufuncs a <- allocMem :: IO (Ptr Word32) b <- allocMem :: IO (Ptr Word32) result <- hb_unicode_decompose ufuncs' ab a b a' <- peek a b' <- peek b touchManagedPtr ufuncs freeMem a freeMem b return (result, a', b') -- function unicode_compose -- Args: [ Arg -- { argCName = "ufuncs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "a" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first Unicode code point to compose" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "b" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The second Unicode code point to compose" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "ab" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The composition of @a, @b" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_compose" hb_unicode_compose :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) Word32 -> -- a : TBasicType TUInt32 Word32 -> -- b : TBasicType TUInt32 Ptr Word32 -> -- ab : TBasicType TUInt32 IO Int32 -- | Fetches the composition of a sequence of two Unicode -- code points. -- -- Calls the composition function of the specified -- Unicode-functions structure /@ufuncs@/. -- -- /Since: 0.9.2/ unicodeCompose :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@ufuncs@/: The Unicode-functions structure -> Word32 -- ^ /@a@/: The first Unicode code point to compose -> Word32 -- ^ /@b@/: The second Unicode code point to compose -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if /@a@/ and /@b@/ composed, @false@ otherwise unicodeCompose :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeFuncsT -> Word32 -> Word32 -> m (Int32, Word32) unicodeCompose UnicodeFuncsT ufuncs Word32 a Word32 b = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT ufuncs ab <- allocMem :: IO (Ptr Word32) result <- hb_unicode_compose ufuncs' a b ab ab' <- peek ab touchManagedPtr ufuncs freeMem ab return (result, ab') -- function unicode_combining_class -- Args: [ Arg -- { argCName = "ufuncs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "unicode" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name -- { namespace = "HarfBuzz" , name = "unicode_combining_class_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_unicode_combining_class" hb_unicode_combining_class :: Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) Word32 -> -- unicode : TBasicType TUInt32 IO CUInt -- | Retrieves the Canonical Combining Class (ccc) property -- of code point /@unicode@/. -- -- /Since: 0.9.2/ unicodeCombiningClass :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@ufuncs@/: The Unicode-functions structure -> Word32 -- ^ /@unicode@/: The code point to query -> m HarfBuzz.Enums.UnicodeCombiningClassT -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.UnicodeCombiningClassT' of /@unicode@/ unicodeCombiningClass :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeFuncsT -> Word32 -> m UnicodeCombiningClassT unicodeCombiningClass UnicodeFuncsT ufuncs Word32 unicode = IO UnicodeCombiningClassT -> m UnicodeCombiningClassT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO UnicodeCombiningClassT -> m UnicodeCombiningClassT) -> IO UnicodeCombiningClassT -> m UnicodeCombiningClassT forall a b. (a -> b) -> a -> b $ do ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnicodeFuncsT ufuncs result <- hb_unicode_combining_class ufuncs' unicode let result' = (Int -> UnicodeCombiningClassT forall a. Enum a => Int -> a toEnum (Int -> UnicodeCombiningClassT) -> (CUInt -> Int) -> CUInt -> UnicodeCombiningClassT forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result touchManagedPtr ufuncs return result' -- function tag_to_string -- XXX Could not generate function tag_to_string -- Not implemented: Don't know how to allocate "buf" of type TCArray False 4 (-1) (TBasicType TUInt8) -- function tag_from_string -- Args: [ Arg -- { argCName = "str" -- , argType = TCArray False (-1) 1 (TBasicType TUInt8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "String to convert" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Length of @str, or -1 if it is `NULL`-terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Length of @str, or -1 if it is `NULL`-terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "hb_tag_from_string" hb_tag_from_string :: Ptr Word8 -> -- str : TCArray False (-1) 1 (TBasicType TUInt8) Int32 -> -- len : TBasicType TInt IO Word32 -- | Converts a string into an @/hb_tag_t/@. Valid tags -- are four characters. Shorter input strings will be -- padded with spaces. Longer input strings will be -- truncated. -- -- /Since: 0.9.2/ tagFromString :: (B.CallStack.HasCallStack, MonadIO m) => ByteString -- ^ /@str@/: String to convert -> m Word32 -- ^ __Returns:__ The @/hb_tag_t/@ corresponding to /@str@/ tagFromString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ByteString -> m Word32 tagFromString ByteString str = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do let len :: Int32 len = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString str str' <- ByteString -> IO (Ptr Word8) packByteString ByteString str result <- hb_tag_from_string str' len freeMem str' return result -- function style_get_value -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #hb_font_t object." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "style_tag" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "style_tag_t" } -- , argCType = Just "hb_style_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a style tag." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TFloat) -- throws : False -- Skip return : False foreign import ccall "hb_style_get_value" hb_style_get_value :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- style_tag : TInterface (Name {namespace = "HarfBuzz", name = "style_tag_t"}) IO CFloat -- | Searches variation axes of a t'GI.HarfBuzz.Structs.FontT.FontT' object for a specific axis first, -- if not set, first tries to get default style values in @STAT@ table -- then tries to polyfill from different tables of the font. -- -- /Since: 3.0.0/ styleGetValue :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: a t'GI.HarfBuzz.Structs.FontT.FontT' object. -> [HarfBuzz.Flags.StyleTagT] -- ^ /@styleTag@/: a style tag. -> m Float -- ^ __Returns:__ Corresponding axis or default value to a style tag. styleGetValue :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [StyleTagT] -> m Float styleGetValue FontT font [StyleTagT] styleTag = IO Float -> m Float forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Float -> m Float) -> IO Float -> m Float forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let styleTag' = [StyleTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [StyleTagT] styleTag result <- hb_style_get_value font' styleTag' let result' = CFloat -> Float forall a b. (Real a, Fractional b) => a -> b realToFrac CFloat result touchManagedPtr font return result' -- function shape_plan_get_shaper -- Args: [ Arg -- { argCName = "shape_plan" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "shape_plan_t" } -- , argCType = Just "hb_shape_plan_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A shaping plan" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "hb_shape_plan_get_shaper" hb_shape_plan_get_shaper :: Ptr HarfBuzz.ShapePlanT.ShapePlanT -> -- shape_plan : TInterface (Name {namespace = "HarfBuzz", name = "shape_plan_t"}) IO CString -- | Fetches the shaper from a given shaping plan. -- -- /Since: 0.9.7/ shapePlanGetShaper :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.ShapePlanT.ShapePlanT -- ^ /@shapePlan@/: A shaping plan -> m T.Text -- ^ __Returns:__ The shaper shapePlanGetShaper :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ShapePlanT -> m Text shapePlanGetShaper ShapePlanT shapePlan = IO Text -> m Text forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Text -> m Text) -> IO Text -> m Text forall a b. (a -> b) -> a -> b $ do shapePlan' <- ShapePlanT -> IO (Ptr ShapePlanT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr ShapePlanT shapePlan result <- hb_shape_plan_get_shaper shapePlan' checkUnexpectedReturnNULL "shapePlanGetShaper" result result' <- cstringToText result touchManagedPtr shapePlan return result' -- function shape_plan_get_empty -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "shape_plan_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_shape_plan_get_empty" hb_shape_plan_get_empty :: IO (Ptr HarfBuzz.ShapePlanT.ShapePlanT) -- | Fetches the singleton empty shaping plan. -- -- /Since: 0.9.7/ shapePlanGetEmpty :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.ShapePlanT.ShapePlanT -- ^ __Returns:__ The empty shaping plan shapePlanGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m ShapePlanT shapePlanGetEmpty = IO ShapePlanT -> m ShapePlanT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO ShapePlanT -> m ShapePlanT) -> IO ShapePlanT -> m ShapePlanT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr ShapePlanT) hb_shape_plan_get_empty checkUnexpectedReturnNULL "shapePlanGetEmpty" result result' <- (wrapBoxed HarfBuzz.ShapePlanT.ShapePlanT) result return result' -- function shape_plan_execute -- Args: [ Arg -- { argCName = "shape_plan" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "shape_plan_t" } -- , argCType = Just "hb_shape_plan_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A shaping plan" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_font_t to use" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_buffer_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "features" -- , argType = -- TCArray -- False -- (-1) -- 4 -- (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" }) -- , argCType = Just "const hb_feature_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Features to enable" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of features to enable" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "num_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of features to enable" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_shape_plan_execute" hb_shape_plan_execute :: Ptr HarfBuzz.ShapePlanT.ShapePlanT -> -- shape_plan : TInterface (Name {namespace = "HarfBuzz", name = "shape_plan_t"}) Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr HarfBuzz.FeatureT.FeatureT -> -- features : TCArray False (-1) 4 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"})) Word32 -> -- num_features : TBasicType TUInt IO Int32 -- | Executes the given shaping plan on the specified buffer, using -- the given /@font@/ and /@features@/. -- -- /Since: 0.9.7/ shapePlanExecute :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.ShapePlanT.ShapePlanT -- ^ /@shapePlan@/: A shaping plan -> HarfBuzz.FontT.FontT -- ^ /@font@/: The t'GI.HarfBuzz.Structs.FontT.FontT' to use -> HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: The t'GI.HarfBuzz.Structs.BufferT.BufferT' to work upon -> [HarfBuzz.FeatureT.FeatureT] -- ^ /@features@/: Features to enable -> m Int32 -- ^ __Returns:__ @true@ if success, @false@ otherwise. shapePlanExecute :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ShapePlanT -> FontT -> BufferT -> [FeatureT] -> m Int32 shapePlanExecute ShapePlanT shapePlan FontT font BufferT buffer [FeatureT] features = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do let numFeatures :: Word32 numFeatures = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [FeatureT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [FeatureT] features shapePlan' <- ShapePlanT -> IO (Ptr ShapePlanT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr ShapePlanT shapePlan font' <- unsafeManagedPtrGetPtr font buffer' <- unsafeManagedPtrGetPtr buffer features' <- mapM unsafeManagedPtrGetPtr features features'' <- packBlockArray 16 features' result <- hb_shape_plan_execute shapePlan' font' buffer' features'' numFeatures touchManagedPtr shapePlan touchManagedPtr font touchManagedPtr buffer mapM_ touchManagedPtr features freeMem features'' return result -- function shape_plan_create_cached2 -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to use" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "props" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "segment_properties_t" } -- , argCType = Just "const hb_segment_properties_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_segment_properties_t of the segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "user_features" -- , argType = -- TCArray -- False -- (-1) -- 3 -- (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" }) -- , argCType = Just "const hb_feature_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The list of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_user_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coords" -- , argType = TCArray False (-1) 5 (TBasicType TInt) -- , argCType = Just "const int*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The list of variation-space coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_coords" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of variation-space coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "shaper_list" -- , argType = TCArray True (-1) (-1) (TBasicType TUTF8) -- , argCType = Just "const char* const*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "List of shapers to try" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "num_coords" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of variation-space coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_user_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "shape_plan_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_shape_plan_create_cached2" hb_shape_plan_create_cached2 :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"}) Ptr HarfBuzz.FeatureT.FeatureT -> -- user_features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"})) Word32 -> -- num_user_features : TBasicType TUInt Ptr Int32 -> -- coords : TCArray False (-1) 5 (TBasicType TInt) Word32 -> -- num_coords : TBasicType TUInt Ptr CString -> -- shaper_list : TCArray True (-1) (-1) (TBasicType TUTF8) IO (Ptr HarfBuzz.ShapePlanT.ShapePlanT) -- | The variable-font version of @/hb_shape_plan_create_cached/@. -- Creates a cached shaping plan suitable for reuse, for a combination -- of /@face@/, /@userFeatures@/, /@props@/, and /@shaperList@/, plus the -- variation-space coordinates /@coords@/. -- -- /Since: 1.4.0/ shapePlanCreateCached2 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to use -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -- ^ /@props@/: The t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' of the segment -> [HarfBuzz.FeatureT.FeatureT] -- ^ /@userFeatures@/: The list of user-selected features -> [Int32] -- ^ /@coords@/: The list of variation-space coordinates -> [T.Text] -- ^ /@shaperList@/: List of shapers to try -> m HarfBuzz.ShapePlanT.ShapePlanT -- ^ __Returns:__ The shaping plan shapePlanCreateCached2 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> SegmentPropertiesT -> [FeatureT] -> [Int32] -> [Text] -> m ShapePlanT shapePlanCreateCached2 FaceT face SegmentPropertiesT props [FeatureT] userFeatures [Int32] coords [Text] shaperList = IO ShapePlanT -> m ShapePlanT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO ShapePlanT -> m ShapePlanT) -> IO ShapePlanT -> m ShapePlanT forall a b. (a -> b) -> a -> b $ do let numCoords :: Word32 numCoords = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Int32] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Int32] coords let numUserFeatures :: Word32 numUserFeatures = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [FeatureT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [FeatureT] userFeatures face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face props' <- unsafeManagedPtrGetPtr props userFeatures' <- mapM unsafeManagedPtrGetPtr userFeatures userFeatures'' <- packBlockArray 16 userFeatures' coords' <- packStorableArray coords shaperList' <- packZeroTerminatedUTF8CArray shaperList result <- hb_shape_plan_create_cached2 face' props' userFeatures'' numUserFeatures coords' numCoords shaperList' checkUnexpectedReturnNULL "shapePlanCreateCached2" result result' <- (wrapBoxed HarfBuzz.ShapePlanT.ShapePlanT) result touchManagedPtr face touchManagedPtr props mapM_ touchManagedPtr userFeatures freeMem userFeatures'' freeMem coords' mapZeroTerminatedCArray freeMem shaperList' freeMem shaperList' return result' -- function shape_plan_create_cached -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to use" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "props" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "segment_properties_t" } -- , argCType = Just "const hb_segment_properties_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_segment_properties_t of the segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "user_features" -- , argType = -- TCArray -- False -- (-1) -- 3 -- (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" }) -- , argCType = Just "const hb_feature_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The list of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_user_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "shaper_list" -- , argType = TCArray True (-1) (-1) (TBasicType TUTF8) -- , argCType = Just "const char* const*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "List of shapers to try" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "num_user_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "shape_plan_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_shape_plan_create_cached" hb_shape_plan_create_cached :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"}) Ptr HarfBuzz.FeatureT.FeatureT -> -- user_features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"})) Word32 -> -- num_user_features : TBasicType TUInt Ptr CString -> -- shaper_list : TCArray True (-1) (-1) (TBasicType TUTF8) IO (Ptr HarfBuzz.ShapePlanT.ShapePlanT) -- | Creates a cached shaping plan suitable for reuse, for a combination -- of /@face@/, /@userFeatures@/, /@props@/, and /@shaperList@/. -- -- /Since: 0.9.7/ shapePlanCreateCached :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to use -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -- ^ /@props@/: The t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' of the segment -> [HarfBuzz.FeatureT.FeatureT] -- ^ /@userFeatures@/: The list of user-selected features -> [T.Text] -- ^ /@shaperList@/: List of shapers to try -> m HarfBuzz.ShapePlanT.ShapePlanT -- ^ __Returns:__ The shaping plan shapePlanCreateCached :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> SegmentPropertiesT -> [FeatureT] -> [Text] -> m ShapePlanT shapePlanCreateCached FaceT face SegmentPropertiesT props [FeatureT] userFeatures [Text] shaperList = IO ShapePlanT -> m ShapePlanT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO ShapePlanT -> m ShapePlanT) -> IO ShapePlanT -> m ShapePlanT forall a b. (a -> b) -> a -> b $ do let numUserFeatures :: Word32 numUserFeatures = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [FeatureT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [FeatureT] userFeatures face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face props' <- unsafeManagedPtrGetPtr props userFeatures' <- mapM unsafeManagedPtrGetPtr userFeatures userFeatures'' <- packBlockArray 16 userFeatures' shaperList' <- packZeroTerminatedUTF8CArray shaperList result <- hb_shape_plan_create_cached face' props' userFeatures'' numUserFeatures shaperList' checkUnexpectedReturnNULL "shapePlanCreateCached" result result' <- (wrapBoxed HarfBuzz.ShapePlanT.ShapePlanT) result touchManagedPtr face touchManagedPtr props mapM_ touchManagedPtr userFeatures freeMem userFeatures'' mapZeroTerminatedCArray freeMem shaperList' freeMem shaperList' return result' -- function shape_plan_create2 -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to use" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "props" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "segment_properties_t" } -- , argCType = Just "const hb_segment_properties_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_segment_properties_t of the segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "user_features" -- , argType = -- TCArray -- False -- (-1) -- 3 -- (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" }) -- , argCType = Just "const hb_feature_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The list of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_user_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coords" -- , argType = TCArray False (-1) 5 (TBasicType TInt) -- , argCType = Just "const int*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The list of variation-space coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_coords" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of variation-space coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "shaper_list" -- , argType = TCArray True (-1) (-1) (TBasicType TUTF8) -- , argCType = Just "const char* const*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "List of shapers to try" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "num_coords" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of variation-space coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_user_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "shape_plan_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_shape_plan_create2" hb_shape_plan_create2 :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"}) Ptr HarfBuzz.FeatureT.FeatureT -> -- user_features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"})) Word32 -> -- num_user_features : TBasicType TUInt Ptr Int32 -> -- coords : TCArray False (-1) 5 (TBasicType TInt) Word32 -> -- num_coords : TBasicType TUInt Ptr CString -> -- shaper_list : TCArray True (-1) (-1) (TBasicType TUTF8) IO (Ptr HarfBuzz.ShapePlanT.ShapePlanT) -- | The variable-font version of @/hb_shape_plan_create/@. -- Constructs a shaping plan for a combination of /@face@/, /@userFeatures@/, /@props@/, -- and /@shaperList@/, plus the variation-space coordinates /@coords@/. -- -- /Since: 1.4.0/ shapePlanCreate2 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to use -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -- ^ /@props@/: The t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' of the segment -> [HarfBuzz.FeatureT.FeatureT] -- ^ /@userFeatures@/: The list of user-selected features -> [Int32] -- ^ /@coords@/: The list of variation-space coordinates -> [T.Text] -- ^ /@shaperList@/: List of shapers to try -> m HarfBuzz.ShapePlanT.ShapePlanT -- ^ __Returns:__ The shaping plan shapePlanCreate2 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> SegmentPropertiesT -> [FeatureT] -> [Int32] -> [Text] -> m ShapePlanT shapePlanCreate2 FaceT face SegmentPropertiesT props [FeatureT] userFeatures [Int32] coords [Text] shaperList = IO ShapePlanT -> m ShapePlanT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO ShapePlanT -> m ShapePlanT) -> IO ShapePlanT -> m ShapePlanT forall a b. (a -> b) -> a -> b $ do let numCoords :: Word32 numCoords = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Int32] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Int32] coords let numUserFeatures :: Word32 numUserFeatures = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [FeatureT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [FeatureT] userFeatures face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face props' <- unsafeManagedPtrGetPtr props userFeatures' <- mapM unsafeManagedPtrGetPtr userFeatures userFeatures'' <- packBlockArray 16 userFeatures' coords' <- packStorableArray coords shaperList' <- packZeroTerminatedUTF8CArray shaperList result <- hb_shape_plan_create2 face' props' userFeatures'' numUserFeatures coords' numCoords shaperList' checkUnexpectedReturnNULL "shapePlanCreate2" result result' <- (wrapBoxed HarfBuzz.ShapePlanT.ShapePlanT) result touchManagedPtr face touchManagedPtr props mapM_ touchManagedPtr userFeatures freeMem userFeatures'' freeMem coords' mapZeroTerminatedCArray freeMem shaperList' freeMem shaperList' return result' -- function shape_plan_create -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to use" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "props" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "segment_properties_t" } -- , argCType = Just "const hb_segment_properties_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_segment_properties_t of the segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "user_features" -- , argType = -- TCArray -- False -- (-1) -- 3 -- (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" }) -- , argCType = Just "const hb_feature_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The list of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_user_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "shaper_list" -- , argType = TCArray True (-1) (-1) (TBasicType TUTF8) -- , argCType = Just "const char* const*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "List of shapers to try" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "num_user_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of user-selected features" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "shape_plan_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_shape_plan_create" hb_shape_plan_create :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"}) Ptr HarfBuzz.FeatureT.FeatureT -> -- user_features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"})) Word32 -> -- num_user_features : TBasicType TUInt Ptr CString -> -- shaper_list : TCArray True (-1) (-1) (TBasicType TUTF8) IO (Ptr HarfBuzz.ShapePlanT.ShapePlanT) -- | Constructs a shaping plan for a combination of /@face@/, /@userFeatures@/, /@props@/, -- and /@shaperList@/. -- -- /Since: 0.9.7/ shapePlanCreate :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to use -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -- ^ /@props@/: The t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' of the segment -> [HarfBuzz.FeatureT.FeatureT] -- ^ /@userFeatures@/: The list of user-selected features -> [T.Text] -- ^ /@shaperList@/: List of shapers to try -> m HarfBuzz.ShapePlanT.ShapePlanT -- ^ __Returns:__ The shaping plan shapePlanCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> SegmentPropertiesT -> [FeatureT] -> [Text] -> m ShapePlanT shapePlanCreate FaceT face SegmentPropertiesT props [FeatureT] userFeatures [Text] shaperList = IO ShapePlanT -> m ShapePlanT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO ShapePlanT -> m ShapePlanT) -> IO ShapePlanT -> m ShapePlanT forall a b. (a -> b) -> a -> b $ do let numUserFeatures :: Word32 numUserFeatures = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [FeatureT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [FeatureT] userFeatures face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face props' <- unsafeManagedPtrGetPtr props userFeatures' <- mapM unsafeManagedPtrGetPtr userFeatures userFeatures'' <- packBlockArray 16 userFeatures' shaperList' <- packZeroTerminatedUTF8CArray shaperList result <- hb_shape_plan_create face' props' userFeatures'' numUserFeatures shaperList' checkUnexpectedReturnNULL "shapePlanCreate" result result' <- (wrapBoxed HarfBuzz.ShapePlanT.ShapePlanT) result touchManagedPtr face touchManagedPtr props mapM_ touchManagedPtr userFeatures freeMem userFeatures'' mapZeroTerminatedCArray freeMem shaperList' freeMem shaperList' return result' -- function shape_list_shapers -- Args: [] -- Lengths: [] -- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "hb_shape_list_shapers" hb_shape_list_shapers :: IO (Ptr CString) -- | Retrieves the list of shapers supported by HarfBuzz. -- -- /Since: 0.9.2/ shapeListShapers :: (B.CallStack.HasCallStack, MonadIO m) => m [T.Text] -- ^ __Returns:__ a -- @NULL@-terminated array of supported shapers constant string. -- The returned array is owned by HarfBuzz and should not be -- modified or freed. shapeListShapers :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [Text] shapeListShapers = IO [Text] -> m [Text] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text] forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr (Ptr CChar)) hb_shape_list_shapers checkUnexpectedReturnNULL "shapeListShapers" result result' <- unpackZeroTerminatedUTF8CArray result return result' -- function shape_full -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_font_t to use for shaping" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_buffer_t to shape" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "features" -- , argType = -- TCArray -- False -- (-1) -- 3 -- (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" }) -- , argCType = Just "const hb_feature_t*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "an array of user\n specified #hb_feature_t or `NULL`" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @features array" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "shaper_list" -- , argType = TCArray True (-1) (-1) (TBasicType TUTF8) -- , argCType = Just "const char* const*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "a `NULL`-terminated\n array of shapers to use or `NULL`" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "num_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @features array" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_shape_full" hb_shape_full :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr HarfBuzz.FeatureT.FeatureT -> -- features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"})) Word32 -> -- num_features : TBasicType TUInt Ptr CString -> -- shaper_list : TCArray True (-1) (-1) (TBasicType TUTF8) IO Int32 -- | See 'GI.HarfBuzz.Functions.shape' for details. If /@shaperList@/ is not @NULL@, the specified -- shapers will be used in the given order, otherwise the default shapers list -- will be used. -- -- /Since: 0.9.2/ shapeFull :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' to use for shaping -> HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' to shape -> Maybe ([HarfBuzz.FeatureT.FeatureT]) -- ^ /@features@/: an array of user -- specified t'GI.HarfBuzz.Structs.FeatureT.FeatureT' or @NULL@ -> Maybe ([T.Text]) -- ^ /@shaperList@/: a @NULL@-terminated -- array of shapers to use or @NULL@ -> m Int32 -- ^ __Returns:__ false if all shapers failed, true otherwise shapeFull :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> BufferT -> Maybe [FeatureT] -> Maybe [Text] -> m Int32 shapeFull FontT font BufferT buffer Maybe [FeatureT] features Maybe [Text] shaperList = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do let numFeatures :: Word32 numFeatures = case Maybe [FeatureT] features of Maybe [FeatureT] Nothing -> Word32 0 Just [FeatureT] jFeatures -> Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [FeatureT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [FeatureT] jFeatures font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font buffer' <- unsafeManagedPtrGetPtr buffer maybeFeatures <- case features of Maybe [FeatureT] Nothing -> Ptr FeatureT -> IO (Ptr FeatureT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr FeatureT forall a. Ptr a FP.nullPtr Just [FeatureT] jFeatures -> do jFeatures' <- (FeatureT -> IO (Ptr FeatureT)) -> [FeatureT] -> IO [Ptr FeatureT] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b] mapM FeatureT -> IO (Ptr FeatureT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [FeatureT] jFeatures jFeatures'' <- packBlockArray 16 jFeatures' return jFeatures'' maybeShaperList <- case shaperList of Maybe [Text] Nothing -> Ptr (Ptr CChar) -> IO (Ptr (Ptr CChar)) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr (Ptr CChar) forall a. Ptr a FP.nullPtr Just [Text] jShaperList -> do jShaperList' <- [Text] -> IO (Ptr (Ptr CChar)) packZeroTerminatedUTF8CArray [Text] jShaperList return jShaperList' result <- hb_shape_full font' buffer' maybeFeatures numFeatures maybeShaperList touchManagedPtr font touchManagedPtr buffer whenJust features (mapM_ touchManagedPtr) freeMem maybeFeatures mapZeroTerminatedCArray freeMem maybeShaperList freeMem maybeShaperList return result -- function shape -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_font_t to use for shaping" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_buffer_t to shape" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "features" -- , argType = -- TCArray -- False -- (-1) -- 3 -- (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" }) -- , argCType = Just "const hb_feature_t*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "an array of user\n specified #hb_feature_t or `NULL`" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @features array" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "num_features" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the length of @features array" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_shape" hb_shape :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr HarfBuzz.FeatureT.FeatureT -> -- features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"})) Word32 -> -- num_features : TBasicType TUInt IO () -- | Shapes /@buffer@/ using /@font@/ turning its Unicode characters content to -- positioned glyphs. If /@features@/ is not @NULL@, it will be used to control the -- features applied during shaping. If two /@features@/ have the same tag but -- overlapping ranges the value of the feature with the higher index takes -- precedence. -- -- /Since: 0.9.2/ shape :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' to use for shaping -> HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' to shape -> Maybe ([HarfBuzz.FeatureT.FeatureT]) -- ^ /@features@/: an array of user -- specified t'GI.HarfBuzz.Structs.FeatureT.FeatureT' or @NULL@ -> m () shape :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> BufferT -> Maybe [FeatureT] -> m () shape FontT font BufferT buffer Maybe [FeatureT] features = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let numFeatures :: Word32 numFeatures = case Maybe [FeatureT] features of Maybe [FeatureT] Nothing -> Word32 0 Just [FeatureT] jFeatures -> Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [FeatureT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [FeatureT] jFeatures font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font buffer' <- unsafeManagedPtrGetPtr buffer maybeFeatures <- case features of Maybe [FeatureT] Nothing -> Ptr FeatureT -> IO (Ptr FeatureT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr FeatureT forall a. Ptr a FP.nullPtr Just [FeatureT] jFeatures -> do jFeatures' <- (FeatureT -> IO (Ptr FeatureT)) -> [FeatureT] -> IO [Ptr FeatureT] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b] mapM FeatureT -> IO (Ptr FeatureT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [FeatureT] jFeatures jFeatures'' <- packBlockArray 16 jFeatures' return jFeatures'' hb_shape font' buffer' maybeFeatures numFeatures touchManagedPtr font touchManagedPtr buffer whenJust features (mapM_ touchManagedPtr) freeMem maybeFeatures return () -- function set_union -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "other" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Another set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_union" hb_set_union :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr HarfBuzz.SetT.SetT -> -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO () -- | Makes /@set@/ the union of /@set@/ and /@other@/. -- -- /Since: 0.9.2/ setUnion :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> HarfBuzz.SetT.SetT -- ^ /@other@/: Another set -> m () setUnion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> SetT -> m () setUnion SetT set SetT other = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set other' <- unsafeManagedPtrGetPtr other hb_set_union set' other' touchManagedPtr set touchManagedPtr other return () -- function set_symmetric_difference -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "other" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Another set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_symmetric_difference" hb_set_symmetric_difference :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr HarfBuzz.SetT.SetT -> -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO () -- | Makes /@set@/ the symmetric difference of /@set@/ -- and /@other@/. -- -- /Since: 0.9.2/ setSymmetricDifference :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> HarfBuzz.SetT.SetT -- ^ /@other@/: Another set -> m () setSymmetricDifference :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> SetT -> m () setSymmetricDifference SetT set SetT other = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set other' <- unsafeManagedPtrGetPtr other hb_set_symmetric_difference set' other' touchManagedPtr set touchManagedPtr other return () -- function set_subtract -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "other" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Another set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_subtract" hb_set_subtract :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr HarfBuzz.SetT.SetT -> -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO () -- | Subtracts the contents of /@other@/ from /@set@/. -- -- /Since: 0.9.2/ setSubtract :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> HarfBuzz.SetT.SetT -- ^ /@other@/: Another set -> m () setSubtract :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> SetT -> m () setSubtract SetT set SetT other = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set other' <- unsafeManagedPtrGetPtr other hb_set_subtract set' other' touchManagedPtr set touchManagedPtr other return () -- function set_set -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "other" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Another set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_set" hb_set_set :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr HarfBuzz.SetT.SetT -> -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO () -- | Makes the contents of /@set@/ equal to the contents of /@other@/. -- -- /Since: 0.9.2/ setSet :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> HarfBuzz.SetT.SetT -- ^ /@other@/: Another set -> m () setSet :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> SetT -> m () setSet SetT set SetT other = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set other' <- unsafeManagedPtrGetPtr other hb_set_set set' other' touchManagedPtr set touchManagedPtr other return () -- function set_previous_range -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = The current first code point in the range\n Output = The first code point in the range" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "last" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The last code point in the range" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_previous_range" hb_set_previous_range :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr Word32 -> -- first : TBasicType TUInt32 Ptr Word32 -> -- last : TBasicType TUInt32 IO Int32 -- | Fetches the previous consecutive range of elements in /@set@/ that -- are greater than current value of /@last@/. -- -- Set /@first@/ to @/HB_SET_VALUE_INVALID/@ to get started. -- -- /Since: 1.8.0/ setPreviousRange :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> Word32 -- ^ /@first@/: Input = The current first code point in the range -- Output = The first code point in the range -> m ((Int32, Word32, Word32)) -- ^ __Returns:__ @true@ if there was a previous range, @false@ otherwise setPreviousRange :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> Word32 -> m (Int32, Word32, Word32) setPreviousRange SetT set Word32 first = IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32)) -> IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set first' <- allocMem :: IO (Ptr Word32) poke first' first last <- allocMem :: IO (Ptr Word32) result <- hb_set_previous_range set' first' last first'' <- peek first' last' <- peek last touchManagedPtr set freeMem first' freeMem last return (result, first'', last') -- function set_previous -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "codepoint" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = Code point to query\n Output = Code point retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_previous" hb_set_previous :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr Word32 -> -- codepoint : TBasicType TUInt32 IO Int32 -- | Fetches the previous element in /@set@/ that is lower than current value of /@codepoint@/. -- -- Set /@codepoint@/ to @/HB_SET_VALUE_INVALID/@ to get started. -- -- /Since: 1.8.0/ setPrevious :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> Word32 -- ^ /@codepoint@/: Input = Code point to query -- Output = Code point retrieved -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if there was a previous value, @false@ otherwise setPrevious :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> Word32 -> m (Int32, Word32) setPrevious SetT set Word32 codepoint = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set codepoint' <- allocMem :: IO (Ptr Word32) poke codepoint' codepoint result <- hb_set_previous set' codepoint' codepoint'' <- peek codepoint' touchManagedPtr set freeMem codepoint' return (result, codepoint'') -- function set_next_range -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first code point in the range" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "last" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = The current last code point in the range\n Output = The last code point in the range" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_next_range" hb_set_next_range :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr Word32 -> -- first : TBasicType TUInt32 Ptr Word32 -> -- last : TBasicType TUInt32 IO Int32 -- | Fetches the next consecutive range of elements in /@set@/ that -- are greater than current value of /@last@/. -- -- Set /@last@/ to @/HB_SET_VALUE_INVALID/@ to get started. -- -- /Since: 0.9.7/ setNextRange :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> Word32 -- ^ /@last@/: Input = The current last code point in the range -- Output = The last code point in the range -> m ((Int32, Word32, Word32)) -- ^ __Returns:__ @true@ if there was a next range, @false@ otherwise setNextRange :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> Word32 -> m (Int32, Word32, Word32) setNextRange SetT set Word32 last = IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32)) -> IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set first <- allocMem :: IO (Ptr Word32) last' <- allocMem :: IO (Ptr Word32) poke last' last result <- hb_set_next_range set' first last' first' <- peek first last'' <- peek last' touchManagedPtr set freeMem first freeMem last' return (result, first', last'') -- function set_next_many -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "codepoint" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Outputting codepoints starting after this one.\n Use #HB_SET_VALUE_INVALID to get started." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out" -- , argType = TCArray False (-1) 3 (TBasicType TUInt32) -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An array of codepoints to write to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The maximum number of codepoints to write out." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The maximum number of codepoints to write out." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_next_many" hb_set_next_many :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Word32 -> -- codepoint : TBasicType TUInt32 Ptr Word32 -> -- out : TCArray False (-1) 3 (TBasicType TUInt32) Word32 -> -- size : TBasicType TUInt IO Word32 -- | Finds the next element in /@set@/ that is greater than /@codepoint@/. Writes out -- codepoints to /@out@/, until either the set runs out of elements, or /@size@/ -- codepoints are written, whichever comes first. -- -- /Since: 4.2.0/ setNextMany :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> Word32 -- ^ /@codepoint@/: Outputting codepoints starting after this one. -- Use @/HB_SET_VALUE_INVALID/@ to get started. -> [Word32] -- ^ /@out@/: An array of codepoints to write to. -> m Word32 -- ^ __Returns:__ the number of values written. setNextMany :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> Word32 -> [Word32] -> m Word32 setNextMany SetT set Word32 codepoint [Word32] out = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do let size :: Word32 size = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Word32] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Word32] out set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set out' <- packStorableArray out result <- hb_set_next_many set' codepoint out' size touchManagedPtr set freeMem out' return result -- function set_next -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "codepoint" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = Code point to query\n Output = Code point retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_next" hb_set_next :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr Word32 -> -- codepoint : TBasicType TUInt32 IO Int32 -- | Fetches the next element in /@set@/ that is greater than current value of /@codepoint@/. -- -- Set /@codepoint@/ to @/HB_SET_VALUE_INVALID/@ to get started. -- -- /Since: 0.9.2/ setNext :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> Word32 -- ^ /@codepoint@/: Input = Code point to query -- Output = Code point retrieved -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if there was a next value, @false@ otherwise setNext :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> Word32 -> m (Int32, Word32) setNext SetT set Word32 codepoint = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set codepoint' <- allocMem :: IO (Ptr Word32) poke codepoint' codepoint result <- hb_set_next set' codepoint' codepoint'' <- peek codepoint' touchManagedPtr set freeMem codepoint' return (result, codepoint'') -- function set_is_subset -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "larger_set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Another set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_is_subset" hb_set_is_subset :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr HarfBuzz.SetT.SetT -> -- larger_set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO Int32 -- | Tests whether /@set@/ is a subset of /@largerSet@/. -- -- /Since: 1.8.1/ setIsSubset :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> HarfBuzz.SetT.SetT -- ^ /@largerSet@/: Another set -> m Int32 -- ^ __Returns:__ @true@ if the /@set@/ is a subset of (or equal to) /@largerSet@/, @false@ otherwise. setIsSubset :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> SetT -> m Int32 setIsSubset SetT set SetT largerSet = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set largerSet' <- unsafeManagedPtrGetPtr largerSet result <- hb_set_is_subset set' largerSet' touchManagedPtr set touchManagedPtr largerSet return result -- function set_is_inverted -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_is_inverted" hb_set_is_inverted :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO Int32 -- | Returns whether the set is inverted. -- -- /Since: 7.0.0/ setIsInverted :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> m Int32 -- ^ __Returns:__ @true@ if the set is inverted, @false@ otherwise setIsInverted :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Int32 setIsInverted SetT set = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set result <- hb_set_is_inverted set' touchManagedPtr set return result -- function set_is_equal -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "other" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Another set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_is_equal" hb_set_is_equal :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr HarfBuzz.SetT.SetT -> -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO Int32 -- | Tests whether /@set@/ and /@other@/ are equal (contain the same -- elements). -- -- /Since: 0.9.7/ setIsEqual :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> HarfBuzz.SetT.SetT -- ^ /@other@/: Another set -> m Int32 -- ^ __Returns:__ @true@ if the two sets are equal, @false@ otherwise. setIsEqual :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> SetT -> m Int32 setIsEqual SetT set SetT other = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set other' <- unsafeManagedPtrGetPtr other result <- hb_set_is_equal set' other' touchManagedPtr set touchManagedPtr other return result -- function set_is_empty -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a set." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_is_empty" hb_set_is_empty :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO Int32 -- | Tests whether a set is empty (contains no elements). -- -- /Since: 0.9.7/ setIsEmpty :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: a set. -> m Int32 -- ^ __Returns:__ @true@ if /@set@/ is empty setIsEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Int32 setIsEmpty SetT set = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set result <- hb_set_is_empty set' touchManagedPtr set return result -- function set_invert -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_invert" hb_set_invert :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO () -- | Inverts the contents of /@set@/. -- -- /Since: 3.0.0/ setInvert :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> m () setInvert :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m () setInvert SetT set = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set hb_set_invert set' touchManagedPtr set return () -- function set_intersect -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "other" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Another set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_intersect" hb_set_intersect :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr HarfBuzz.SetT.SetT -> -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO () -- | Makes /@set@/ the intersection of /@set@/ and /@other@/. -- -- /Since: 0.9.2/ setIntersect :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> HarfBuzz.SetT.SetT -- ^ /@other@/: Another set -> m () setIntersect :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> SetT -> m () setIntersect SetT set SetT other = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set other' <- unsafeManagedPtrGetPtr other hb_set_intersect set' other' touchManagedPtr set touchManagedPtr other return () -- function set_hash -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_hash" hb_set_hash :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO Word32 -- | Creates a hash representing /@set@/. -- -- /Since: 4.4.0/ setHash :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> m Word32 -- ^ __Returns:__ A hash of /@set@/. setHash :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Word32 setHash SetT set = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set result <- hb_set_hash set' touchManagedPtr set return result -- function set_has -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "codepoint" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The element to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_has" hb_set_has :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Word32 -> -- codepoint : TBasicType TUInt32 IO Int32 -- | Tests whether /@codepoint@/ belongs to /@set@/. -- -- /Since: 0.9.2/ setHas :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> Word32 -- ^ /@codepoint@/: The element to query -> m Int32 -- ^ __Returns:__ @true@ if /@codepoint@/ is in /@set@/, @false@ otherwise setHas :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> Word32 -> m Int32 setHas SetT set Word32 codepoint = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set result <- hb_set_has set' codepoint touchManagedPtr set return result -- function set_get_population -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_get_population" hb_set_get_population :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO Word32 -- | Returns the number of elements in the set. -- -- /Since: 0.9.7/ setGetPopulation :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> m Word32 -- ^ __Returns:__ The population of /@set@/ setGetPopulation :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Word32 setGetPopulation SetT set = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set result <- hb_set_get_population set' touchManagedPtr set return result -- function set_get_min -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "hb_set_get_min" hb_set_get_min :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO Word32 -- | Finds the smallest element in the set. -- -- /Since: 0.9.7/ setGetMin :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> m Word32 -- ^ __Returns:__ minimum of /@set@/, or @/HB_SET_VALUE_INVALID/@ if /@set@/ is empty. setGetMin :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Word32 setGetMin SetT set = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set result <- hb_set_get_min set' touchManagedPtr set return result -- function set_get_max -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "hb_set_get_max" hb_set_get_max :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO Word32 -- | Finds the largest element in the set. -- -- /Since: 0.9.7/ setGetMax :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> m Word32 -- ^ __Returns:__ maximum of /@set@/, or @/HB_SET_VALUE_INVALID/@ if /@set@/ is empty. setGetMax :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Word32 setGetMax SetT set = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set result <- hb_set_get_max set' touchManagedPtr set return result -- function set_get_empty -- Args: [] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "set_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_set_get_empty" hb_set_get_empty :: IO (Ptr HarfBuzz.SetT.SetT) -- | Fetches the singleton empty t'GI.HarfBuzz.Structs.SetT.SetT'. -- -- /Since: 0.9.2/ setGetEmpty :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.SetT.SetT -- ^ __Returns:__ The empty t'GI.HarfBuzz.Structs.SetT.SetT' setGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SetT setGetEmpty = IO SetT -> m SetT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO SetT -> m SetT) -> IO SetT -> m SetT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr SetT) hb_set_get_empty checkUnexpectedReturnNULL "setGetEmpty" result result' <- (wrapBoxed HarfBuzz.SetT.SetT) result return result' -- function set_del_range -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first element to remove from @set" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "last" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The final element to remove from @set" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_del_range" hb_set_del_range :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Word32 -> -- first : TBasicType TUInt32 Word32 -> -- last : TBasicType TUInt32 IO () -- | Removes all of the elements from /@first@/ to /@last@/ -- (inclusive) from /@set@/. -- -- If /@last@/ is @/HB_SET_VALUE_INVALID/@, then all values -- greater than or equal to /@first@/ are removed. -- -- /Since: 0.9.7/ setDelRange :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> Word32 -- ^ /@first@/: The first element to remove from /@set@/ -> Word32 -- ^ /@last@/: The final element to remove from /@set@/ -> m () setDelRange :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> Word32 -> Word32 -> m () setDelRange SetT set Word32 first Word32 last = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set hb_set_del_range set' first last touchManagedPtr set return () -- function set_del -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "codepoint" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Removes @codepoint from @set" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_del" hb_set_del :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Word32 -> -- codepoint : TBasicType TUInt32 IO () -- | Removes /@codepoint@/ from /@set@/. -- -- /Since: 0.9.2/ setDel :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> Word32 -- ^ /@codepoint@/: Removes /@codepoint@/ from /@set@/ -> m () setDel :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> Word32 -> m () setDel SetT set Word32 codepoint = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set hb_set_del set' codepoint touchManagedPtr set return () -- function set_create -- Args: [] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "set_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_set_create" hb_set_create :: IO (Ptr HarfBuzz.SetT.SetT) -- | Creates a new, initially empty set. -- -- /Since: 0.9.2/ setCreate :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.SetT.SetT -- ^ __Returns:__ The new t'GI.HarfBuzz.Structs.SetT.SetT' setCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SetT setCreate = IO SetT -> m SetT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO SetT -> m SetT) -> IO SetT -> m SetT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr SetT) hb_set_create checkUnexpectedReturnNULL "setCreate" result result' <- (wrapBoxed HarfBuzz.SetT.SetT) result return result' -- function set_copy -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "set_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_set_copy" hb_set_copy :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO (Ptr HarfBuzz.SetT.SetT) -- | Allocate a copy of /@set@/. -- -- /Since: 2.8.2/ setCopy :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> m HarfBuzz.SetT.SetT -- ^ __Returns:__ Newly-allocated set. setCopy :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m SetT setCopy SetT set = IO SetT -> m SetT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO SetT -> m SetT) -> IO SetT -> m SetT forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set result <- hb_set_copy set' checkUnexpectedReturnNULL "setCopy" result result' <- (wrapBoxed HarfBuzz.SetT.SetT) result touchManagedPtr set return result' -- function set_clear -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_clear" hb_set_clear :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO () -- | Clears out the contents of a set. -- -- /Since: 0.9.2/ setClear :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> m () setClear :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m () setClear SetT set = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set hb_set_clear set' touchManagedPtr set return () -- function set_allocation_successful -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "const hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_set_allocation_successful" hb_set_allocation_successful :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO Int32 -- | Tests whether memory allocation for a set was successful. -- -- /Since: 0.9.2/ setAllocationSuccessful :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> m Int32 -- ^ __Returns:__ @true@ if allocation succeeded, @false@ otherwise setAllocationSuccessful :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Int32 setAllocationSuccessful SetT set = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set result <- hb_set_allocation_successful set' touchManagedPtr set return result -- function set_add_sorted_array -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "sorted_codepoints" -- , argType = TCArray False (-1) 2 (TBasicType TUInt32) -- , argCType = Just "const hb_codepoint_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Array of codepoints to add" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_codepoints" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Length of @sorted_codepoints" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "num_codepoints" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Length of @sorted_codepoints" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_add_sorted_array" hb_set_add_sorted_array :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Ptr Word32 -> -- sorted_codepoints : TCArray False (-1) 2 (TBasicType TUInt32) Word32 -> -- num_codepoints : TBasicType TUInt IO () -- | Adds /@numCodepoints@/ codepoints to a set at once. -- The codepoints array must be in increasing order, -- with size at least /@numCodepoints@/. -- -- /Since: 4.1.0/ setAddSortedArray :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> [Word32] -- ^ /@sortedCodepoints@/: Array of codepoints to add -> m () setAddSortedArray :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> [Word32] -> m () setAddSortedArray SetT set [Word32] sortedCodepoints = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let numCodepoints :: Word32 numCodepoints = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Word32] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Word32] sortedCodepoints set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set sortedCodepoints' <- packStorableArray sortedCodepoints hb_set_add_sorted_array set' sortedCodepoints' numCodepoints touchManagedPtr set freeMem sortedCodepoints' return () -- function set_add_range -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first element to add to @set" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "last" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The final element to add to @set" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_add_range" hb_set_add_range :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Word32 -> -- first : TBasicType TUInt32 Word32 -> -- last : TBasicType TUInt32 IO () -- | Adds all of the elements from /@first@/ to /@last@/ -- (inclusive) to /@set@/. -- -- /Since: 0.9.7/ setAddRange :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> Word32 -- ^ /@first@/: The first element to add to /@set@/ -> Word32 -- ^ /@last@/: The final element to add to /@set@/ -> m () setAddRange :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> Word32 -> Word32 -> m () setAddRange SetT set Word32 first Word32 last = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set hb_set_add_range set' first last touchManagedPtr set return () -- function set_add -- Args: [ Arg -- { argCName = "set" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "codepoint" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The element to add to @set" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_set_add" hb_set_add :: Ptr HarfBuzz.SetT.SetT -> -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) Word32 -> -- codepoint : TBasicType TUInt32 IO () -- | Adds /@codepoint@/ to /@set@/. -- -- /Since: 0.9.2/ setAdd :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SetT.SetT -- ^ /@set@/: A set -> Word32 -- ^ /@codepoint@/: The element to add to /@set@/ -> m () setAdd :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> Word32 -> m () setAdd SetT set Word32 codepoint = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do set' <- SetT -> IO (Ptr SetT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SetT set hb_set_add set' codepoint touchManagedPtr set return () -- function segment_properties_overlay -- Args: [ Arg -- { argCName = "p" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "segment_properties_t" } -- , argCType = Just "hb_segment_properties_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_segment_properties_t to fill in." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "src" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "segment_properties_t" } -- , argCType = Just "const hb_segment_properties_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_segment_properties_t to fill in from." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_segment_properties_overlay" hb_segment_properties_overlay :: Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- p : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"}) Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- src : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"}) IO () -- | Fills in missing fields of /@p@/ from /@src@/ in a considered manner. -- -- First, if /@p@/ does not have direction set, direction is copied from /@src@/. -- -- Next, if /@p@/ and /@src@/ have the same direction (which can be unset), if /@p@/ -- does not have script set, script is copied from /@src@/. -- -- Finally, if /@p@/ and /@src@/ have the same direction and script (which either -- can be unset), if /@p@/ does not have language set, language is copied from -- /@src@/. -- -- /Since: 3.3.0/ segmentPropertiesOverlay :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -- ^ /@p@/: t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to fill in. -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -- ^ /@src@/: t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to fill in from. -> m () segmentPropertiesOverlay :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SegmentPropertiesT -> SegmentPropertiesT -> m () segmentPropertiesOverlay SegmentPropertiesT p SegmentPropertiesT src = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do p' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SegmentPropertiesT p src' <- unsafeManagedPtrGetPtr src hb_segment_properties_overlay p' src' touchManagedPtr p touchManagedPtr src return () -- function segment_properties_hash -- Args: [ Arg -- { argCName = "p" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "segment_properties_t" } -- , argCType = Just "const hb_segment_properties_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_segment_properties_t to hash." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_segment_properties_hash" hb_segment_properties_hash :: Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- p : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"}) IO Word32 -- | Creates a hash representing /@p@/. -- -- /Since: 0.9.7/ segmentPropertiesHash :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -- ^ /@p@/: t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to hash. -> m Word32 -- ^ __Returns:__ A hash of /@p@/. segmentPropertiesHash :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SegmentPropertiesT -> m Word32 segmentPropertiesHash SegmentPropertiesT p = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do p' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SegmentPropertiesT p result <- hb_segment_properties_hash p' touchManagedPtr p return result -- function segment_properties_equal -- Args: [ Arg -- { argCName = "a" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "segment_properties_t" } -- , argCType = Just "const hb_segment_properties_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "first #hb_segment_properties_t to compare." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "b" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "segment_properties_t" } -- , argCType = Just "const hb_segment_properties_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "second #hb_segment_properties_t to compare." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_segment_properties_equal" hb_segment_properties_equal :: Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- a : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"}) Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- b : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"}) IO Int32 -- | Checks the equality of two t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT'\'s. -- -- /Since: 0.9.7/ segmentPropertiesEqual :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -- ^ /@a@/: first t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to compare. -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -- ^ /@b@/: second t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to compare. -> m Int32 -- ^ __Returns:__ @true@ if all properties of /@a@/ equal those of /@b@/, @false@ otherwise. segmentPropertiesEqual :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SegmentPropertiesT -> SegmentPropertiesT -> m Int32 segmentPropertiesEqual SegmentPropertiesT a SegmentPropertiesT b = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do a' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr SegmentPropertiesT a b' <- unsafeManagedPtrGetPtr b result <- hb_segment_properties_equal a' b' touchManagedPtr a touchManagedPtr b return result -- function script_to_iso15924_tag -- Args: [ Arg -- { argCName = "script" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "script_t" } -- , argCType = Just "hb_script_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_script_t to convert." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "hb_script_to_iso15924_tag" hb_script_to_iso15924_tag :: CUInt -> -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"}) IO Word32 -- | Converts an t'GI.HarfBuzz.Flags.ScriptT' to a corresponding ISO 15924 script tag. -- -- /Since: 0.9.2/ scriptToIso15924Tag :: (B.CallStack.HasCallStack, MonadIO m) => [HarfBuzz.Flags.ScriptT] -- ^ /@script@/: an t'GI.HarfBuzz.Flags.ScriptT' to convert. -> m Word32 -- ^ __Returns:__ An @/hb_tag_t/@ representing an ISO 15924 script tag. scriptToIso15924Tag :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [ScriptT] -> m Word32 scriptToIso15924Tag [ScriptT] script = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do let script' :: CUInt script' = [ScriptT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ScriptT] script result <- CUInt -> IO Word32 hb_script_to_iso15924_tag CUInt script' return result -- function script_get_horizontal_direction -- Args: [ Arg -- { argCName = "script" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "script_t" } -- , argCType = Just "hb_script_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_script_t to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_script_get_horizontal_direction" hb_script_get_horizontal_direction :: CUInt -> -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"}) IO CUInt -- | Fetches the t'GI.HarfBuzz.Enums.DirectionT' of a script when it is -- set horizontally. All right-to-left scripts will return -- @/HB_DIRECTION_RTL/@. All left-to-right scripts will return -- @/HB_DIRECTION_LTR/@. -- -- Scripts that can be written either right-to-left or -- left-to-right will return @/HB_DIRECTION_INVALID/@. -- -- Unknown scripts will return @/HB_DIRECTION_LTR/@. -- -- /Since: 0.9.2/ scriptGetHorizontalDirection :: (B.CallStack.HasCallStack, MonadIO m) => [HarfBuzz.Flags.ScriptT] -- ^ /@script@/: The t'GI.HarfBuzz.Flags.ScriptT' to query -> m HarfBuzz.Enums.DirectionT -- ^ __Returns:__ The horizontal t'GI.HarfBuzz.Enums.DirectionT' of /@script@/ scriptGetHorizontalDirection :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [ScriptT] -> m DirectionT scriptGetHorizontalDirection [ScriptT] script = IO DirectionT -> m DirectionT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO DirectionT -> m DirectionT) -> IO DirectionT -> m DirectionT forall a b. (a -> b) -> a -> b $ do let script' :: CUInt script' = [ScriptT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ScriptT] script result <- CUInt -> IO CUInt hb_script_get_horizontal_direction CUInt script' let result' = (Int -> DirectionT forall a. Enum a => Int -> a toEnum (Int -> DirectionT) -> (CUInt -> Int) -> CUInt -> DirectionT forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result return result' -- function script_from_string -- Args: [ Arg -- { argCName = "str" -- , argType = TCArray False (-1) 1 (TBasicType TUInt8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "a string representing an\n ISO 15924 tag." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "length of the @str, or -1 if it is `NULL`-terminated." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "length of the @str, or -1 if it is `NULL`-terminated." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "script_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_script_from_string" hb_script_from_string :: Ptr Word8 -> -- str : TCArray False (-1) 1 (TBasicType TUInt8) Int32 -> -- len : TBasicType TInt IO CUInt -- | Converts a string /@str@/ representing an ISO 15924 script tag to a -- corresponding t'GI.HarfBuzz.Flags.ScriptT'. Shorthand for 'GI.HarfBuzz.Functions.tagFromString' then -- 'GI.HarfBuzz.Functions.scriptFromIso15924Tag'. -- -- /Since: 0.9.2/ scriptFromString :: (B.CallStack.HasCallStack, MonadIO m) => ByteString -- ^ /@str@/: a string representing an -- ISO 15924 tag. -> m [HarfBuzz.Flags.ScriptT] -- ^ __Returns:__ An t'GI.HarfBuzz.Flags.ScriptT' corresponding to the ISO 15924 tag. scriptFromString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ByteString -> m [ScriptT] scriptFromString ByteString str = IO [ScriptT] -> m [ScriptT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [ScriptT] -> m [ScriptT]) -> IO [ScriptT] -> m [ScriptT] forall a b. (a -> b) -> a -> b $ do let len :: Int32 len = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString str str' <- ByteString -> IO (Ptr Word8) packByteString ByteString str result <- hb_script_from_string str' len let result' = CUInt -> [ScriptT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result freeMem str' return result' -- function script_from_iso15924_tag -- Args: [ Arg -- { argCName = "tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_tag_t representing an ISO 15924 tag." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "script_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_script_from_iso15924_tag" hb_script_from_iso15924_tag :: Word32 -> -- tag : TBasicType TUInt32 IO CUInt -- | Converts an ISO 15924 script tag to a corresponding t'GI.HarfBuzz.Flags.ScriptT'. -- -- /Since: 0.9.2/ scriptFromIso15924Tag :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@tag@/: an @/hb_tag_t/@ representing an ISO 15924 tag. -> m [HarfBuzz.Flags.ScriptT] -- ^ __Returns:__ An t'GI.HarfBuzz.Flags.ScriptT' corresponding to the ISO 15924 tag. scriptFromIso15924Tag :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> m [ScriptT] scriptFromIso15924Tag Word32 tag = IO [ScriptT] -> m [ScriptT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [ScriptT] -> m [ScriptT]) -> IO [ScriptT] -> m [ScriptT] forall a b. (a -> b) -> a -> b $ do result <- Word32 -> IO CUInt hb_script_from_iso15924_tag Word32 tag let result' = CUInt -> [ScriptT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result return result' -- function realloc -- Args: [ Arg -- { argCName = "ptr" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The pointer to the memory to reallocate." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "size" -- , argType = TBasicType TSize -- , argCType = Just "size_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The new size of the memory." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TPtr) -- throws : False -- Skip return : False foreign import ccall "hb_realloc" hb_realloc :: Ptr () -> -- ptr : TBasicType TPtr FCT.CSize -> -- size : TBasicType TSize IO (Ptr ()) -- | Reallocates the memory pointed to by /@ptr@/ to /@size@/ bytes, using the -- allocator set at compile-time. Typically just @/realloc()/@. -- -- /Since: 11.0.0/ realloc :: (B.CallStack.HasCallStack, MonadIO m) => Ptr () -- ^ /@ptr@/: The pointer to the memory to reallocate. -> FCT.CSize -- ^ /@size@/: The new size of the memory. -> m (Ptr ()) -- ^ __Returns:__ A pointer to the reallocated memory. realloc :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Ptr () -> CSize -> m (Ptr ()) realloc Ptr () ptr CSize size = IO (Ptr ()) -> m (Ptr ()) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ()) forall a b. (a -> b) -> a -> b $ do result <- Ptr () -> CSize -> IO (Ptr ()) hb_realloc Ptr () ptr CSize size return result -- function paint_sweep_gradient -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "color_line" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "color_line_t" } -- , argCType = Just "hb_color_line_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Color information for the gradient" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x0" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X coordinate of the circle's center" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y0" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y coordinate of the circle's center" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_angle" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the start angle" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "end_angle" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the end angle" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_sweep_gradient" hb_paint_sweep_gradient :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Ptr HarfBuzz.ColorLineT.ColorLineT -> -- color_line : TInterface (Name {namespace = "HarfBuzz", name = "color_line_t"}) CFloat -> -- x0 : TBasicType TFloat CFloat -> -- y0 : TBasicType TFloat CFloat -> -- start_angle : TBasicType TFloat CFloat -> -- end_angle : TBasicType TFloat IO () -- | Perform a \"sweep-gradient\" paint operation. -- -- /Since: 7.0.0/ paintSweepGradient :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> HarfBuzz.ColorLineT.ColorLineT -- ^ /@colorLine@/: Color information for the gradient -> Float -- ^ /@x0@/: X coordinate of the circle\'s center -> Float -- ^ /@y0@/: Y coordinate of the circle\'s center -> Float -- ^ /@startAngle@/: the start angle -> Float -- ^ /@endAngle@/: the end angle -> m () paintSweepGradient :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> ColorLineT -> Float -> Float -> Float -> Float -> m () paintSweepGradient PaintFuncsT funcs Ptr () paintData ColorLineT colorLine Float x0 Float y0 Float startAngle Float endAngle = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs colorLine' <- unsafeManagedPtrGetPtr colorLine let x0' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float x0 let y0' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float y0 let startAngle' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float startAngle let endAngle' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float endAngle hb_paint_sweep_gradient funcs' paintData colorLine' x0' y0' startAngle' endAngle' touchManagedPtr funcs touchManagedPtr colorLine return () -- function paint_radial_gradient -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "color_line" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "color_line_t" } -- , argCType = Just "hb_color_line_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Color information for the gradient" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x0" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X coordinate of the first circle's center" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y0" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y coordinate of the first circle's center" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "r0" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "radius of the first circle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x1" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X coordinate of the second circle's center" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y1" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y coordinate of the second circle's center" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "r1" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "radius of the second circle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_radial_gradient" hb_paint_radial_gradient :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Ptr HarfBuzz.ColorLineT.ColorLineT -> -- color_line : TInterface (Name {namespace = "HarfBuzz", name = "color_line_t"}) CFloat -> -- x0 : TBasicType TFloat CFloat -> -- y0 : TBasicType TFloat CFloat -> -- r0 : TBasicType TFloat CFloat -> -- x1 : TBasicType TFloat CFloat -> -- y1 : TBasicType TFloat CFloat -> -- r1 : TBasicType TFloat IO () -- | Perform a \"radial-gradient\" paint operation. -- -- /Since: 7.0.0/ paintRadialGradient :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> HarfBuzz.ColorLineT.ColorLineT -- ^ /@colorLine@/: Color information for the gradient -> Float -- ^ /@x0@/: X coordinate of the first circle\'s center -> Float -- ^ /@y0@/: Y coordinate of the first circle\'s center -> Float -- ^ /@r0@/: radius of the first circle -> Float -- ^ /@x1@/: X coordinate of the second circle\'s center -> Float -- ^ /@y1@/: Y coordinate of the second circle\'s center -> Float -- ^ /@r1@/: radius of the second circle -> m () paintRadialGradient :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> ColorLineT -> Float -> Float -> Float -> Float -> Float -> Float -> m () paintRadialGradient PaintFuncsT funcs Ptr () paintData ColorLineT colorLine Float x0 Float y0 Float r0 Float x1 Float y1 Float r1 = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs colorLine' <- unsafeManagedPtrGetPtr colorLine let x0' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float x0 let y0' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float y0 let r0' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float r0 let x1' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float x1 let y1' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float y1 let r1' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float r1 hb_paint_radial_gradient funcs' paintData colorLine' x0' y0' r0' x1' y1' r1' touchManagedPtr funcs touchManagedPtr colorLine return () -- function paint_push_transform -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "xx" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "xx component of the transform matrix" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "yx" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "yx component of the transform matrix" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "xy" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "xy component of the transform matrix" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "yy" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "yy component of the transform matrix" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "dx" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "dx component of the transform matrix" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "dy" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "dy component of the transform matrix" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_push_transform" hb_paint_push_transform :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr CFloat -> -- xx : TBasicType TFloat CFloat -> -- yx : TBasicType TFloat CFloat -> -- xy : TBasicType TFloat CFloat -> -- yy : TBasicType TFloat CFloat -> -- dx : TBasicType TFloat CFloat -> -- dy : TBasicType TFloat IO () -- | Perform a \"push-transform\" paint operation. -- -- /Since: 7.0.0/ paintPushTransform :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> Float -- ^ /@xx@/: xx component of the transform matrix -> Float -- ^ /@yx@/: yx component of the transform matrix -> Float -- ^ /@xy@/: xy component of the transform matrix -> Float -- ^ /@yy@/: yy component of the transform matrix -> Float -- ^ /@dx@/: dx component of the transform matrix -> Float -- ^ /@dy@/: dy component of the transform matrix -> m () paintPushTransform :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> Float -> Float -> Float -> Float -> Float -> Float -> m () paintPushTransform PaintFuncsT funcs Ptr () paintData Float xx Float yx Float xy Float yy Float dx Float dy = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs let xx' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float xx let yx' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float yx let xy' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float xy let yy' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float yy let dx' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float dx let dy' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float dy hb_paint_push_transform funcs' paintData xx' yx' xy' yy' dx' dy' touchManagedPtr funcs return () -- function paint_push_inverse_font_transform -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "const hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a font" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_push_inverse_font_transform" hb_paint_push_inverse_font_transform :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO () -- | Push the inverse of the transform reflecting the font\'s -- scale and slant settings onto the paint functions. -- -- /Since: 11.0.0/ paintPushInverseFontTransform :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> HarfBuzz.FontT.FontT -- ^ /@font@/: a font -> m () paintPushInverseFontTransform :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> FontT -> m () paintPushInverseFontTransform PaintFuncsT funcs Ptr () paintData FontT font = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs font' <- unsafeManagedPtrGetPtr font hb_paint_push_inverse_font_transform funcs' paintData font' touchManagedPtr funcs touchManagedPtr font return () -- function paint_push_group -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_push_group" hb_paint_push_group :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr IO () -- | Perform a \"push-group\" paint operation. -- -- /Since: 7.0.0/ paintPushGroup :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> m () paintPushGroup :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> m () paintPushGroup PaintFuncsT funcs Ptr () paintData = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs hb_paint_push_group funcs' paintData touchManagedPtr funcs return () -- function paint_push_font_transform -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "const hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a font" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_push_font_transform" hb_paint_push_font_transform :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO () -- | Push the transform reflecting the font\'s scale and slant -- settings onto the paint functions. -- -- /Since: 11.0.0/ paintPushFontTransform :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> HarfBuzz.FontT.FontT -- ^ /@font@/: a font -> m () paintPushFontTransform :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> FontT -> m () paintPushFontTransform PaintFuncsT funcs Ptr () paintData FontT font = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs font' <- unsafeManagedPtrGetPtr font hb_paint_push_font_transform funcs' paintData font' touchManagedPtr funcs touchManagedPtr font return () -- function paint_push_clip_rectangle -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "xmin" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "min X for the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "ymin" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "min Y for the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "xmax" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "max X for the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "ymax" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "max Y for the rectangle" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_push_clip_rectangle" hb_paint_push_clip_rectangle :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr CFloat -> -- xmin : TBasicType TFloat CFloat -> -- ymin : TBasicType TFloat CFloat -> -- xmax : TBasicType TFloat CFloat -> -- ymax : TBasicType TFloat IO () -- | Perform a \"push-clip-rect\" paint operation. -- -- /Since: 7.0.0/ paintPushClipRectangle :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> Float -- ^ /@xmin@/: min X for the rectangle -> Float -- ^ /@ymin@/: min Y for the rectangle -> Float -- ^ /@xmax@/: max X for the rectangle -> Float -- ^ /@ymax@/: max Y for the rectangle -> m () paintPushClipRectangle :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> Float -> Float -> Float -> Float -> m () paintPushClipRectangle PaintFuncsT funcs Ptr () paintData Float xmin Float ymin Float xmax Float ymax = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs let xmin' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float xmin let ymin' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float ymin let xmax' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float xmax let ymax' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float ymax hb_paint_push_clip_rectangle funcs' paintData xmin' ymin' xmax' ymax' touchManagedPtr funcs return () -- function paint_push_clip_glyph -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the glyph ID" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the font" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_push_clip_glyph" hb_paint_push_clip_glyph :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Word32 -> -- glyph : TBasicType TUInt32 Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO () -- | Perform a \"push-clip-glyph\" paint operation. -- -- /Since: 7.0.0/ paintPushClipGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> Word32 -- ^ /@glyph@/: the glyph ID -> HarfBuzz.FontT.FontT -- ^ /@font@/: the font -> m () paintPushClipGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> Word32 -> FontT -> m () paintPushClipGlyph PaintFuncsT funcs Ptr () paintData Word32 glyph FontT font = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs font' <- unsafeManagedPtrGetPtr font hb_paint_push_clip_glyph funcs' paintData glyph font' touchManagedPtr funcs touchManagedPtr font return () -- function paint_pop_transform -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_pop_transform" hb_paint_pop_transform :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr IO () -- | Perform a \"pop-transform\" paint operation. -- -- /Since: 7.0.0/ paintPopTransform :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> m () paintPopTransform :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> m () paintPopTransform PaintFuncsT funcs Ptr () paintData = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs hb_paint_pop_transform funcs' paintData touchManagedPtr funcs return () -- function paint_pop_group -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "mode" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "paint_composite_mode_t" } -- , argCType = Just "hb_paint_composite_mode_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the compositing mode to use" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_pop_group" hb_paint_pop_group :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr CUInt -> -- mode : TInterface (Name {namespace = "HarfBuzz", name = "paint_composite_mode_t"}) IO () -- | Perform a \"pop-group\" paint operation. -- -- /Since: 7.0.0/ paintPopGroup :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> HarfBuzz.Enums.PaintCompositeModeT -- ^ /@mode@/: the compositing mode to use -> m () paintPopGroup :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> PaintCompositeModeT -> m () paintPopGroup PaintFuncsT funcs Ptr () paintData PaintCompositeModeT mode = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs let mode' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (PaintCompositeModeT -> Int) -> PaintCompositeModeT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . PaintCompositeModeT -> Int forall a. Enum a => a -> Int fromEnum) PaintCompositeModeT mode hb_paint_pop_group funcs' paintData mode' touchManagedPtr funcs return () -- function paint_pop_clip -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_pop_clip" hb_paint_pop_clip :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr IO () -- | Perform a \"pop-clip\" paint operation. -- -- /Since: 7.0.0/ paintPopClip :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> m () paintPopClip :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> m () paintPopClip PaintFuncsT funcs Ptr () paintData = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs hb_paint_pop_clip funcs' paintData touchManagedPtr funcs return () -- function paint_linear_gradient -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "color_line" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "color_line_t" } -- , argCType = Just "hb_color_line_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Color information for the gradient" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x0" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X coordinate of the first point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y0" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y coordinate of the first point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x1" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X coordinate of the second point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y1" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y coordinate of the second point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x2" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X coordinate of the third point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y2" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y coordinate of the third point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_linear_gradient" hb_paint_linear_gradient :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Ptr HarfBuzz.ColorLineT.ColorLineT -> -- color_line : TInterface (Name {namespace = "HarfBuzz", name = "color_line_t"}) CFloat -> -- x0 : TBasicType TFloat CFloat -> -- y0 : TBasicType TFloat CFloat -> -- x1 : TBasicType TFloat CFloat -> -- y1 : TBasicType TFloat CFloat -> -- x2 : TBasicType TFloat CFloat -> -- y2 : TBasicType TFloat IO () -- | Perform a \"linear-gradient\" paint operation. -- -- /Since: 7.0.0/ paintLinearGradient :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> HarfBuzz.ColorLineT.ColorLineT -- ^ /@colorLine@/: Color information for the gradient -> Float -- ^ /@x0@/: X coordinate of the first point -> Float -- ^ /@y0@/: Y coordinate of the first point -> Float -- ^ /@x1@/: X coordinate of the second point -> Float -- ^ /@y1@/: Y coordinate of the second point -> Float -- ^ /@x2@/: X coordinate of the third point -> Float -- ^ /@y2@/: Y coordinate of the third point -> m () paintLinearGradient :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> ColorLineT -> Float -> Float -> Float -> Float -> Float -> Float -> m () paintLinearGradient PaintFuncsT funcs Ptr () paintData ColorLineT colorLine Float x0 Float y0 Float x1 Float y1 Float x2 Float y2 = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs colorLine' <- unsafeManagedPtrGetPtr colorLine let x0' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float x0 let y0' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float y0 let x1' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float x1 let y1' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float y1 let x2' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float x2 let y2' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float y2 hb_paint_linear_gradient funcs' paintData colorLine' x0' y0' x1' y1' x2' y2' touchManagedPtr funcs touchManagedPtr colorLine return () -- function paint_image -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "image" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "image data" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "width" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "width of the raster image in pixels, or 0" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "height" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "height of the raster image in pixels, or 0" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "format" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the image format as a tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "slant" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Deprecated. set to 0.0" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "extents" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "glyph_extents_t" } -- , argCType = Just "hb_glyph_extents_t*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "the extents of the glyph" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_image" hb_paint_image :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Ptr HarfBuzz.BlobT.BlobT -> -- image : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) Word32 -> -- width : TBasicType TUInt Word32 -> -- height : TBasicType TUInt Word32 -> -- format : TBasicType TUInt32 CFloat -> -- slant : TBasicType TFloat Ptr HarfBuzz.GlyphExtentsT.GlyphExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "glyph_extents_t"}) IO () -- | Perform a \"image\" paint operation. -- -- /Since: 7.0.0/ paintImage :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> HarfBuzz.BlobT.BlobT -- ^ /@image@/: image data -> Word32 -- ^ /@width@/: width of the raster image in pixels, or 0 -> Word32 -- ^ /@height@/: height of the raster image in pixels, or 0 -> Word32 -- ^ /@format@/: the image format as a tag -> Float -- ^ /@slant@/: Deprecated. set to 0.0 -> Maybe (HarfBuzz.GlyphExtentsT.GlyphExtentsT) -- ^ /@extents@/: the extents of the glyph -> m () paintImage :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> BlobT -> Word32 -> Word32 -> Word32 -> Float -> Maybe GlyphExtentsT -> m () paintImage PaintFuncsT funcs Ptr () paintData BlobT image Word32 width Word32 height Word32 format Float slant Maybe GlyphExtentsT extents = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs image' <- unsafeManagedPtrGetPtr image let slant' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float slant maybeExtents <- case extents of Maybe GlyphExtentsT Nothing -> Ptr GlyphExtentsT -> IO (Ptr GlyphExtentsT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr GlyphExtentsT forall a. Ptr a FP.nullPtr Just GlyphExtentsT jExtents -> do jExtents' <- GlyphExtentsT -> IO (Ptr GlyphExtentsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GlyphExtentsT jExtents return jExtents' hb_paint_image funcs' paintData image' width height format slant' maybeExtents touchManagedPtr funcs touchManagedPtr image whenJust extents touchManagedPtr return () -- function paint_funcs_set_sweep_gradient_func -- XXX Could not generate function paint_funcs_set_sweep_gradient_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_radial_gradient_func -- XXX Could not generate function paint_funcs_set_radial_gradient_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_push_transform_func -- XXX Could not generate function paint_funcs_set_push_transform_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_push_group_func -- XXX Could not generate function paint_funcs_set_push_group_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_push_clip_rectangle_func -- XXX Could not generate function paint_funcs_set_push_clip_rectangle_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_push_clip_glyph_func -- XXX Could not generate function paint_funcs_set_push_clip_glyph_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_pop_transform_func -- XXX Could not generate function paint_funcs_set_pop_transform_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_pop_group_func -- XXX Could not generate function paint_funcs_set_pop_group_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_pop_clip_func -- XXX Could not generate function paint_funcs_set_pop_clip_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_linear_gradient_func -- XXX Could not generate function paint_funcs_set_linear_gradient_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_image_func -- XXX Could not generate function paint_funcs_set_image_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_custom_palette_color_func -- XXX Could not generate function paint_funcs_set_custom_palette_color_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_color_glyph_func -- XXX Could not generate function paint_funcs_set_color_glyph_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_set_color_func -- XXX Could not generate function paint_funcs_set_color_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function paint_funcs_make_immutable -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The paint-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_funcs_make_immutable" hb_paint_funcs_make_immutable :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) IO () -- | Makes a paint-functions structure immutable. -- -- After this call, all attempts to set one of the callbacks -- on /@funcs@/ will fail. -- -- /Since: 7.0.0/ paintFuncsMakeImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: The paint-functions structure -> m () paintFuncsMakeImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> m () paintFuncsMakeImmutable PaintFuncsT funcs = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs hb_paint_funcs_make_immutable funcs' touchManagedPtr funcs return () -- function paint_funcs_is_immutable -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The paint-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_paint_funcs_is_immutable" hb_paint_funcs_is_immutable :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) IO Int32 -- | Tests whether a paint-functions structure is immutable. -- -- /Since: 7.0.0/ paintFuncsIsImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: The paint-functions structure -> m Int32 -- ^ __Returns:__ @true@ if /@funcs@/ is immutable, @false@ otherwise paintFuncsIsImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> m Int32 paintFuncsIsImmutable PaintFuncsT funcs = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs result <- hb_paint_funcs_is_immutable funcs' touchManagedPtr funcs return result -- function paint_funcs_get_empty -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "paint_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_paint_funcs_get_empty" hb_paint_funcs_get_empty :: IO (Ptr HarfBuzz.PaintFuncsT.PaintFuncsT) -- | Fetches the singleton empty paint-functions structure. -- -- /Since: 7.0.0/ paintFuncsGetEmpty :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ __Returns:__ The empty paint-functions structure paintFuncsGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m PaintFuncsT paintFuncsGetEmpty = IO PaintFuncsT -> m PaintFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO PaintFuncsT -> m PaintFuncsT) -> IO PaintFuncsT -> m PaintFuncsT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr PaintFuncsT) hb_paint_funcs_get_empty checkUnexpectedReturnNULL "paintFuncsGetEmpty" result result' <- (wrapBoxed HarfBuzz.PaintFuncsT.PaintFuncsT) result return result' -- function paint_funcs_create -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "paint_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_paint_funcs_create" hb_paint_funcs_create :: IO (Ptr HarfBuzz.PaintFuncsT.PaintFuncsT) -- | Creates a new t'GI.HarfBuzz.Structs.PaintFuncsT.PaintFuncsT' structure of paint functions. -- -- The initial reference count of 1 should be released with @/hb_paint_funcs_destroy()/@ -- when you are done using the t'GI.HarfBuzz.Structs.PaintFuncsT.PaintFuncsT'. This function never returns -- @NULL@. If memory cannot be allocated, a special singleton t'GI.HarfBuzz.Structs.PaintFuncsT.PaintFuncsT' -- object will be returned. -- -- /Since: 7.0.0/ paintFuncsCreate :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ __Returns:__ the paint-functions structure paintFuncsCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m PaintFuncsT paintFuncsCreate = IO PaintFuncsT -> m PaintFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO PaintFuncsT -> m PaintFuncsT) -> IO PaintFuncsT -> m PaintFuncsT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr PaintFuncsT) hb_paint_funcs_create checkUnexpectedReturnNULL "paintFuncsCreate" result result' <- (wrapBoxed HarfBuzz.PaintFuncsT.PaintFuncsT) result return result' -- function paint_custom_palette_color -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "color_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "color index" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "color" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_color_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "fetched color" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_paint_custom_palette_color" hb_paint_custom_palette_color :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Word32 -> -- color_index : TBasicType TUInt Ptr Word32 -> -- color : TBasicType TUInt32 IO Int32 -- | Gets the custom palette color for /@colorIndex@/. -- -- /Since: 7.0.0/ paintCustomPaletteColor :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> Word32 -- ^ /@colorIndex@/: color index -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if found, @false@ otherwise paintCustomPaletteColor :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> Word32 -> m (Int32, Word32) paintCustomPaletteColor PaintFuncsT funcs Ptr () paintData Word32 colorIndex = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs color <- allocMem :: IO (Ptr Word32) result <- hb_paint_custom_palette_color funcs' paintData colorIndex color color' <- peek color touchManagedPtr funcs freeMem color return (result, color') -- function paint_color_glyph -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the glyph ID" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the font" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_paint_color_glyph" hb_paint_color_glyph :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Word32 -> -- glyph : TBasicType TUInt32 Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO Int32 -- | Perform a \"color-glyph\" paint operation. -- -- /Since: 8.2.0/ paintColorGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> Word32 -- ^ /@glyph@/: the glyph ID -> HarfBuzz.FontT.FontT -- ^ /@font@/: the font -> m Int32 paintColorGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> Word32 -> FontT -> m Int32 paintColorGlyph PaintFuncsT funcs Ptr () paintData Word32 glyph FontT font = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs font' <- unsafeManagedPtrGetPtr font result <- hb_paint_color_glyph funcs' paintData glyph font' touchManagedPtr funcs touchManagedPtr font return result -- function paint_color -- Args: [ Arg -- { argCName = "funcs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "paint functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "is_foreground" -- , argType = TBasicType TInt -- , argCType = Just "hb_bool_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "whether the color is the foreground" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "color" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_color_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The color to use" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_paint_color" hb_paint_color :: Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- funcs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Int32 -> -- is_foreground : TBasicType TInt Word32 -> -- color : TBasicType TUInt32 IO () -- | Perform a \"color\" paint operation. -- -- /Since: 7.0.0/ paintColor :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@funcs@/: paint functions -> Ptr () -- ^ /@paintData@/: associated data passed by the caller -> Int32 -- ^ /@isForeground@/: whether the color is the foreground -> Word32 -- ^ /@color@/: The color to use -> m () paintColor :: forall (m :: * -> *). (HasCallStack, MonadIO m) => PaintFuncsT -> Ptr () -> Int32 -> Word32 -> m () paintColor PaintFuncsT funcs Ptr () paintData Int32 isForeground Word32 color = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do funcs' <- PaintFuncsT -> IO (Ptr PaintFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr PaintFuncsT funcs hb_paint_color funcs' paintData isForeground color touchManagedPtr funcs return () -- function ot_var_normalize_variations -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_face_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "variations" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "variation_t" } -- , argCType = Just "const hb_variation_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The array of variations to normalize" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "variations_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of variations to normalize" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coords" -- , argType = TCArray False (-1) 4 (TBasicType TInt) -- , argCType = Just "int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The array of normalized coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "coords_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The length of the coordinate array" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "coords_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The length of the coordinate array" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_normalize_variations" hb_ot_var_normalize_variations :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Ptr HarfBuzz.VariationT.VariationT -> -- variations : TInterface (Name {namespace = "HarfBuzz", name = "variation_t"}) Word32 -> -- variations_length : TBasicType TUInt Ptr (Ptr Int32) -> -- coords : TCArray False (-1) 4 (TBasicType TInt) Ptr Word32 -> -- coords_length : TBasicType TUInt IO () -- | Normalizes all of the coordinates in the given list of variation axes. -- -- /Since: 1.4.2/ otVarNormalizeVariations :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on -> HarfBuzz.VariationT.VariationT -- ^ /@variations@/: The array of variations to normalize -> Word32 -- ^ /@variationsLength@/: The number of variations to normalize -> m ([Int32]) otVarNormalizeVariations :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> VariationT -> Word32 -> m [Int32] otVarNormalizeVariations FaceT face VariationT variations Word32 variationsLength = IO [Int32] -> m [Int32] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Int32] -> m [Int32]) -> IO [Int32] -> m [Int32] forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face variations' <- unsafeManagedPtrGetPtr variations coords <- callocMem :: IO (Ptr (Ptr Int32)) coordsLength <- allocMem :: IO (Ptr Word32) hb_ot_var_normalize_variations face' variations' variationsLength coords coordsLength coordsLength' <- peek coordsLength coords' <- peek coords coords'' <- (unpackStorableArrayWithLength coordsLength') coords' freeMem coords' touchManagedPtr face touchManagedPtr variations freeMem coords freeMem coordsLength return coords'' -- function ot_var_normalize_coords -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_face_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coords_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The length of the coordinate array" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "design_coords" -- , argType = TBasicType TFloat -- , argCType = Just "const float*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The design-space coordinates to normalize" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "normalized_coords" -- , argType = TBasicType TInt -- , argCType = Just "int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The normalized coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_normalize_coords" hb_ot_var_normalize_coords :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- coords_length : TBasicType TUInt CFloat -> -- design_coords : TBasicType TFloat Ptr Int32 -> -- normalized_coords : TBasicType TInt IO () -- | Normalizes the given design-space coordinates. The minimum and maximum -- values for the axis are mapped to the interval [-1,1], with the default -- axis value mapped to 0. -- -- The normalized values have 14 bits of fixed-point sub-integer precision as per -- OpenType specification. -- -- Any additional scaling defined in the face\'s @avar@ table is also -- applied, as described at https:\/\/docs.microsoft.com\/en-us\/typography\/opentype\/spec\/avar -- -- Note: /@coordsLength@/ must be the same as the number of axes in the face, as -- for example returned by 'GI.HarfBuzz.Functions.otVarGetAxisCount'. -- Otherwise, the behavior is undefined. -- -- /Since: 1.4.2/ otVarNormalizeCoords :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on -> Word32 -- ^ /@coordsLength@/: The length of the coordinate array -> Float -- ^ /@designCoords@/: The design-space coordinates to normalize -> m (Int32) otVarNormalizeCoords :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Float -> m Int32 otVarNormalizeCoords FaceT face Word32 coordsLength Float designCoords = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face let designCoords' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float designCoords normalizedCoords <- allocMem :: IO (Ptr Int32) hb_ot_var_normalize_coords face' coordsLength designCoords' normalizedCoords normalizedCoords' <- peek normalizedCoords touchManagedPtr face freeMem normalizedCoords return normalizedCoords' -- function ot_var_named_instance_get_subfamily_name_id -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_face_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "instance_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the named instance to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_named_instance_get_subfamily_name_id" hb_ot_var_named_instance_get_subfamily_name_id :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- instance_index : TBasicType TUInt IO Word32 -- | Fetches the @name@ table Name ID that provides display names for -- the \"Subfamily name\" defined for the given named instance in the face. -- -- /Since: 2.2.0/ otVarNamedInstanceGetSubfamilyNameId :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on -> Word32 -- ^ /@instanceIndex@/: The index of the named instance to query -> m Word32 -- ^ __Returns:__ the Name ID found for the Subfamily name otVarNamedInstanceGetSubfamilyNameId :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m Word32 otVarNamedInstanceGetSubfamilyNameId FaceT face Word32 instanceIndex = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_var_named_instance_get_subfamily_name_id face' instanceIndex touchManagedPtr face return result -- function ot_var_named_instance_get_postscript_name_id -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_face_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "instance_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the named instance to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_named_instance_get_postscript_name_id" hb_ot_var_named_instance_get_postscript_name_id :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- instance_index : TBasicType TUInt IO Word32 -- | Fetches the @name@ table Name ID that provides display names for -- the \"PostScript name\" defined for the given named instance in the face. -- -- /Since: 2.2.0/ otVarNamedInstanceGetPostscriptNameId :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on -> Word32 -- ^ /@instanceIndex@/: The index of the named instance to query -> m Word32 -- ^ __Returns:__ the Name ID found for the PostScript name otVarNamedInstanceGetPostscriptNameId :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m Word32 otVarNamedInstanceGetPostscriptNameId FaceT face Word32 instanceIndex = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_var_named_instance_get_postscript_name_id face' instanceIndex touchManagedPtr face return result -- function ot_var_named_instance_get_design_coords -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_face_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "instance_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the named instance to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coords_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of coordinates to return;\n Output = the actual number of coordinates returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "coords" -- , argType = TCArray False (-1) 2 (TBasicType TFloat) -- , argCType = Just "float*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The array of coordinates found for the query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "coords_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of coordinates to return;\n Output = the actual number of coordinates returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_named_instance_get_design_coords" hb_ot_var_named_instance_get_design_coords :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- instance_index : TBasicType TUInt Ptr Word32 -> -- coords_length : TBasicType TUInt Ptr (Ptr CFloat) -> -- coords : TCArray False (-1) 2 (TBasicType TFloat) IO Word32 -- | Fetches the design-space coordinates corresponding to the given -- named instance in the face. -- -- /Since: 2.2.0/ otVarNamedInstanceGetDesignCoords :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on -> Word32 -- ^ /@instanceIndex@/: The index of the named instance to query -> m ((Word32, [Float])) -- ^ __Returns:__ the number of variation axes in the face otVarNamedInstanceGetDesignCoords :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m (Word32, [Float]) otVarNamedInstanceGetDesignCoords FaceT face Word32 instanceIndex = IO (Word32, [Float]) -> m (Word32, [Float]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Float]) -> m (Word32, [Float])) -> IO (Word32, [Float]) -> m (Word32, [Float]) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face coordsLength <- allocMem :: IO (Ptr Word32) coords <- callocMem :: IO (Ptr (Ptr CFloat)) result <- hb_ot_var_named_instance_get_design_coords face' instanceIndex coordsLength coords coordsLength' <- peek coordsLength coords' <- peek coords coords'' <- (unpackMapStorableArrayWithLength realToFrac coordsLength') coords' freeMem coords' touchManagedPtr face freeMem coordsLength freeMem coords return (result, coords'') -- function ot_var_has_data -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_face_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_has_data" hb_ot_var_has_data :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether a face includes any OpenType variation data in the @fvar@ table. -- -- /Since: 1.4.2/ otVarHasData :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise otVarHasData :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 otVarHasData FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_var_has_data face' touchManagedPtr face return result -- function ot_var_get_named_instance_count -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_face_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_get_named_instance_count" hb_ot_var_get_named_instance_count :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Word32 -- | Fetches the number of named instances included in the face. -- -- /Since: 2.2.0/ otVarGetNamedInstanceCount :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on -> m Word32 -- ^ __Returns:__ the number of named instances defined otVarGetNamedInstanceCount :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Word32 otVarGetNamedInstanceCount FaceT face = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_var_get_named_instance_count face' touchManagedPtr face return result -- function ot_var_get_axis_infos -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first lookup to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "axes_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of variation axes to return;\n Output = the actual number of variation axes returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "axes_array" -- , argType = -- TCArray -- False -- (-1) -- 2 -- (TInterface -- Name { namespace = "HarfBuzz" , name = "ot_var_axis_info_t" }) -- , argCType = Just "hb_ot_var_axis_info_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The array of variation axes found" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "axes_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of variation axes to return;\n Output = the actual number of variation axes returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_get_axis_infos" hb_ot_var_get_axis_infos :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- start_offset : TBasicType TUInt Word32 -> -- axes_count : TBasicType TUInt Ptr HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT -> -- axes_array : TCArray False (-1) 2 (TInterface (Name {namespace = "HarfBuzz", name = "ot_var_axis_info_t"})) IO Word32 -- | Fetches a list of all variation axes in the specified face. The list returned will begin -- at the offset provided. -- -- /Since: 2.2.0/ otVarGetAxisInfos :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@startOffset@/: offset of the first lookup to retrieve -> [HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT] -- ^ /@axesArray@/: The array of variation axes found -> m ((Word32, [HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT])) -- ^ __Returns:__ the number of variation axes in the face otVarGetAxisInfos :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> [OtVarAxisInfoT] -> m (Word32, [OtVarAxisInfoT]) otVarGetAxisInfos FaceT face Word32 startOffset [OtVarAxisInfoT] axesArray = IO (Word32, [OtVarAxisInfoT]) -> m (Word32, [OtVarAxisInfoT]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [OtVarAxisInfoT]) -> m (Word32, [OtVarAxisInfoT])) -> IO (Word32, [OtVarAxisInfoT]) -> m (Word32, [OtVarAxisInfoT]) forall a b. (a -> b) -> a -> b $ do let axesCount :: Word32 axesCount = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [OtVarAxisInfoT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [OtVarAxisInfoT] axesArray face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face axesArray' <- mapM B.ManagedPtr.disownBoxed axesArray axesArray'' <- packBlockArray 32 axesArray' result <- hb_ot_var_get_axis_infos face' startOffset axesCount axesArray'' axesArray''' <- (unpackBoxedArrayWithLength 32 axesCount) axesArray'' axesArray'''' <- mapM (wrapBoxed HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT) axesArray''' freeMem axesArray'' touchManagedPtr face mapM_ touchManagedPtr axesArray return (result, axesArray'''') -- function ot_var_get_axis_count -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_face_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_get_axis_count" hb_ot_var_get_axis_count :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Word32 -- | Fetches the number of OpenType variation axes included in the face. -- -- /Since: 1.4.2/ otVarGetAxisCount :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on -> m Word32 -- ^ __Returns:__ the number of variation axes defined otVarGetAxisCount :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Word32 otVarGetAxisCount FaceT face = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_var_get_axis_count face' touchManagedPtr face return result -- function ot_var_get_axes -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first lookup to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "axes_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of variation axes to return;\n Output = the actual number of variation axes returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "axes_array" -- , argType = -- TCArray -- False -- (-1) -- 2 -- (TInterface -- Name { namespace = "HarfBuzz" , name = "ot_var_axis_t" }) -- , argCType = Just "hb_ot_var_axis_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The array of variation axes found" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "axes_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of variation axes to return;\n Output = the actual number of variation axes returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_get_axes" hb_ot_var_get_axes :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- start_offset : TBasicType TUInt Word32 -> -- axes_count : TBasicType TUInt Ptr HarfBuzz.OtVarAxisT.OtVarAxisT -> -- axes_array : TCArray False (-1) 2 (TInterface (Name {namespace = "HarfBuzz", name = "ot_var_axis_t"})) IO Word32 {-# DEPRECATED otVarGetAxes ["(Since version 2.2.0)","use 'GI.HarfBuzz.Functions.otVarGetAxisInfos' instead"] #-} -- | Fetches a list of all variation axes in the specified face. The list returned will begin -- at the offset provided. -- -- /Since: 1.4.2/ otVarGetAxes :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@startOffset@/: offset of the first lookup to retrieve -> [HarfBuzz.OtVarAxisT.OtVarAxisT] -- ^ /@axesArray@/: The array of variation axes found -> m ((Word32, [HarfBuzz.OtVarAxisT.OtVarAxisT])) otVarGetAxes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> [OtVarAxisT] -> m (Word32, [OtVarAxisT]) otVarGetAxes FaceT face Word32 startOffset [OtVarAxisT] axesArray = IO (Word32, [OtVarAxisT]) -> m (Word32, [OtVarAxisT]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [OtVarAxisT]) -> m (Word32, [OtVarAxisT])) -> IO (Word32, [OtVarAxisT]) -> m (Word32, [OtVarAxisT]) forall a b. (a -> b) -> a -> b $ do let axesCount :: Word32 axesCount = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [OtVarAxisT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [OtVarAxisT] axesArray face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face axesArray' <- mapM unsafeManagedPtrGetPtr axesArray axesArray'' <- packBlockArray 20 axesArray' result <- hb_ot_var_get_axes face' startOffset axesCount axesArray'' axesArray''' <- (unpackBlockArrayWithLength 20 axesCount) axesArray'' axesArray'''' <- mapM (wrapPtr HarfBuzz.OtVarAxisT.OtVarAxisT) axesArray''' freeMem axesArray'' touchManagedPtr face mapM_ touchManagedPtr axesArray return (result, axesArray'''') -- function ot_var_find_axis_info -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "axis_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_tag_t of the variation axis to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "axis_info" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_var_axis_info_t" } -- , argCType = Just "hb_ot_var_axis_info_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The #hb_ot_var_axis_info_t of the axis tag queried" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_find_axis_info" hb_ot_var_find_axis_info :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- axis_tag : TBasicType TUInt32 Ptr HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT -> -- axis_info : TInterface (Name {namespace = "HarfBuzz", name = "ot_var_axis_info_t"}) IO Int32 -- | Fetches the variation-axis information corresponding to the specified axis tag -- in the specified face. -- -- /Since: 2.2.0/ otVarFindAxisInfo :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@axisTag@/: The @/hb_tag_t/@ of the variation axis to query -> m ((Int32, HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise otVarFindAxisInfo :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m (Int32, OtVarAxisInfoT) otVarFindAxisInfo FaceT face Word32 axisTag = IO (Int32, OtVarAxisInfoT) -> m (Int32, OtVarAxisInfoT) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, OtVarAxisInfoT) -> m (Int32, OtVarAxisInfoT)) -> IO (Int32, OtVarAxisInfoT) -> m (Int32, OtVarAxisInfoT) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face axisInfo <- SP.callocBoxedBytes 32 :: IO (Ptr HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT) result <- hb_ot_var_find_axis_info face' axisTag axisInfo axisInfo' <- (wrapBoxed HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT) axisInfo touchManagedPtr face return (result, axisInfo') -- function ot_var_find_axis -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "axis_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_tag_t of the variation axis to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "axis_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the variation axis" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "axis_info" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "ot_var_axis_t" } -- , argCType = Just "hb_ot_var_axis_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The #hb_ot_var_axis_info_t of the axis tag queried" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_var_find_axis" hb_ot_var_find_axis :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- axis_tag : TBasicType TUInt32 Word32 -> -- axis_index : TBasicType TUInt Ptr HarfBuzz.OtVarAxisT.OtVarAxisT -> -- axis_info : TInterface (Name {namespace = "HarfBuzz", name = "ot_var_axis_t"}) IO Int32 {-# DEPRECATED otVarFindAxis ["(Since version 2.2.0)","use 'GI.HarfBuzz.Functions.otVarFindAxisInfo' instead"] #-} -- | Fetches the variation-axis information corresponding to the specified axis tag -- in the specified face. -- -- /Since: 1.4.2/ otVarFindAxis :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@axisTag@/: The @/hb_tag_t/@ of the variation axis to query -> Word32 -- ^ /@axisIndex@/: The index of the variation axis -> m ((Int32, HarfBuzz.OtVarAxisT.OtVarAxisT)) otVarFindAxis :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> m (Int32, OtVarAxisT) otVarFindAxis FaceT face Word32 axisTag Word32 axisIndex = IO (Int32, OtVarAxisT) -> m (Int32, OtVarAxisT) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, OtVarAxisT) -> m (Int32, OtVarAxisT)) -> IO (Int32, OtVarAxisT) -> m (Int32, OtVarAxisT) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face axisInfo <- SP.callocBytes 20 :: IO (Ptr HarfBuzz.OtVarAxisT.OtVarAxisT) result <- hb_ot_var_find_axis face' axisTag axisIndex axisInfo axisInfo' <- (wrapPtr HarfBuzz.OtVarAxisT.OtVarAxisT) axisInfo touchManagedPtr face return (result, axisInfo') -- function ot_tags_to_script_and_language -- XXX Could not generate function ot_tags_to_script_and_language -- Not implemented: Don't know how to allocate "language" of type TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) -- function ot_tags_from_script_and_language -- Args: [ Arg -- { argCName = "script" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "script_t" } -- , argCType = Just "hb_script_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_script_t to convert." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_language_t to convert." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "maximum number of script tags to retrieve (IN)\nand actual number of script tags retrieved (OUT)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "script_tags" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "array of size at least @script_count to store the\nscript tag results" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "language_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "maximum number of language tags to retrieve\n(IN) and actual number of language tags retrieved (OUT)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "language_tags" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "array of size at least @language_count to store\nthe language tag results" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_ot_tags_from_script_and_language" :: CUInt -> -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"}) Ptr HarfBuzz.LanguageT.LanguageT -> -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) Ptr Word32 -> -- script_count : TBasicType TUInt Ptr Word32 -> -- script_tags : TBasicType TUInt32 Ptr Word32 -> -- language_count : TBasicType TUInt Ptr Word32 -> -- language_tags : TBasicType TUInt32 IO () -- | Converts an t'GI.HarfBuzz.Flags.ScriptT' and an t'GI.HarfBuzz.Structs.LanguageT.LanguageT' to script and language tags. -- -- /Since: 2.0.0/ otTagsFromScriptAndLanguage :: (B.CallStack.HasCallStack, MonadIO m) => [HarfBuzz.Flags.ScriptT] -- ^ /@script@/: an t'GI.HarfBuzz.Flags.ScriptT' to convert. -> Maybe (HarfBuzz.LanguageT.LanguageT) -- ^ /@language@/: an t'GI.HarfBuzz.Structs.LanguageT.LanguageT' to convert. -> Word32 -- ^ /@scriptCount@/: maximum number of script tags to retrieve (IN) -- and actual number of script tags retrieved (OUT) -> Word32 -- ^ /@languageCount@/: maximum number of language tags to retrieve -- (IN) and actual number of language tags retrieved (OUT) -> m ((Word32, Word32, Word32, Word32)) otTagsFromScriptAndLanguage :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [ScriptT] -> Maybe LanguageT -> Word32 -> Word32 -> m (Word32, Word32, Word32, Word32) otTagsFromScriptAndLanguage [ScriptT] script Maybe LanguageT language Word32 scriptCount Word32 languageCount = IO (Word32, Word32, Word32, Word32) -> m (Word32, Word32, Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, Word32, Word32, Word32) -> m (Word32, Word32, Word32, Word32)) -> IO (Word32, Word32, Word32, Word32) -> m (Word32, Word32, Word32, Word32) forall a b. (a -> b) -> a -> b $ do let script' :: CUInt script' = [ScriptT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ScriptT] script maybeLanguage <- case Maybe LanguageT language of Maybe LanguageT Nothing -> Ptr LanguageT -> IO (Ptr LanguageT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr LanguageT forall a. Ptr a FP.nullPtr Just LanguageT jLanguage -> do jLanguage' <- LanguageT -> IO (Ptr LanguageT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr LanguageT jLanguage return jLanguage' scriptCount' <- allocMem :: IO (Ptr Word32) poke scriptCount' scriptCount scriptTags <- allocMem :: IO (Ptr Word32) languageCount' <- allocMem :: IO (Ptr Word32) poke languageCount' languageCount languageTags <- allocMem :: IO (Ptr Word32) hb_ot_tags_from_script_and_language script' maybeLanguage scriptCount' scriptTags languageCount' languageTags scriptCount'' <- peek scriptCount' scriptTags' <- peek scriptTags languageCount'' <- peek languageCount' languageTags' <- peek languageTags whenJust language touchManagedPtr freeMem scriptCount' freeMem scriptTags freeMem languageCount' freeMem languageTags return (scriptCount'', scriptTags', languageCount'', languageTags') -- function ot_tags_from_script -- Args: [ Arg -- { argCName = "script" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "script_t" } -- , argCType = Just "hb_script_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_script_t to convert." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_tag_1" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "output #hb_tag_t." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "script_tag_2" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "output #hb_tag_t." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_ot_tags_from_script" :: CUInt -> -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"}) Ptr Word32 -> -- script_tag_1 : TBasicType TUInt32 Ptr Word32 -> -- script_tag_2 : TBasicType TUInt32 IO () {-# DEPRECATED otTagsFromScript ["(Since version 2.0.0)","use 'GI.HarfBuzz.Functions.otTagsFromScriptAndLanguage' instead"] #-} -- | Converts an t'GI.HarfBuzz.Flags.ScriptT' to script tags. -- -- /Since: 0.6.0/ otTagsFromScript :: (B.CallStack.HasCallStack, MonadIO m) => [HarfBuzz.Flags.ScriptT] -- ^ /@script@/: an t'GI.HarfBuzz.Flags.ScriptT' to convert. -> m ((Word32, Word32)) otTagsFromScript :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [ScriptT] -> m (Word32, Word32) otTagsFromScript [ScriptT] script = IO (Word32, Word32) -> m (Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, Word32) -> m (Word32, Word32)) -> IO (Word32, Word32) -> m (Word32, Word32) forall a b. (a -> b) -> a -> b $ do let script' :: CUInt script' = [ScriptT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ScriptT] script scriptTag1 <- IO (Ptr Word32) forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) scriptTag2 <- allocMem :: IO (Ptr Word32) hb_ot_tags_from_script script' scriptTag1 scriptTag2 scriptTag1' <- peek scriptTag1 scriptTag2' <- peek scriptTag2 freeMem scriptTag1 freeMem scriptTag2 return (scriptTag1', scriptTag2') -- function ot_tag_to_script -- Args: [ Arg -- { argCName = "tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a script tag" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "script_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ot_tag_to_script" hb_ot_tag_to_script :: Word32 -> -- tag : TBasicType TUInt32 IO CUInt -- | Converts a script tag to an t'GI.HarfBuzz.Flags.ScriptT'. otTagToScript :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@tag@/: a script tag -> m [HarfBuzz.Flags.ScriptT] -- ^ __Returns:__ The t'GI.HarfBuzz.Flags.ScriptT' corresponding to /@tag@/. otTagToScript :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> m [ScriptT] otTagToScript Word32 tag = IO [ScriptT] -> m [ScriptT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [ScriptT] -> m [ScriptT]) -> IO [ScriptT] -> m [ScriptT] forall a b. (a -> b) -> a -> b $ do result <- Word32 -> IO CUInt hb_ot_tag_to_script Word32 tag let result' = CUInt -> [ScriptT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result return result' -- function ot_tag_to_language -- Args: [ Arg -- { argCName = "tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an language tag" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "language_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ot_tag_to_language" hb_ot_tag_to_language :: Word32 -> -- tag : TBasicType TUInt32 IO (Ptr HarfBuzz.LanguageT.LanguageT) -- | Converts a language tag to an t'GI.HarfBuzz.Structs.LanguageT.LanguageT'. -- -- /Since: 0.9.2/ otTagToLanguage :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@tag@/: an language tag -> m (Maybe HarfBuzz.LanguageT.LanguageT) -- ^ __Returns:__ -- The t'GI.HarfBuzz.Structs.LanguageT.LanguageT' corresponding to /@tag@/. otTagToLanguage :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> m (Maybe LanguageT) otTagToLanguage Word32 tag = IO (Maybe LanguageT) -> m (Maybe LanguageT) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe LanguageT) -> m (Maybe LanguageT)) -> IO (Maybe LanguageT) -> m (Maybe LanguageT) forall a b. (a -> b) -> a -> b $ do result <- Word32 -> IO (Ptr LanguageT) hb_ot_tag_to_language Word32 tag maybeResult <- convertIfNonNull result $ \Ptr LanguageT result' -> do result'' <- ((ManagedPtr LanguageT -> LanguageT) -> Ptr LanguageT -> IO LanguageT forall a. (HasCallStack, BoxedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a newPtr ManagedPtr LanguageT -> LanguageT HarfBuzz.LanguageT.LanguageT) Ptr LanguageT result' return result'' return maybeResult -- function ot_tag_from_language -- Args: [ Arg -- { argCName = "language" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_language_t to convert." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "hb_ot_tag_from_language" hb_ot_tag_from_language :: Ptr HarfBuzz.LanguageT.LanguageT -> -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) IO Word32 {-# DEPRECATED otTagFromLanguage ["(Since version 2.0.0)","use 'GI.HarfBuzz.Functions.otTagsFromScriptAndLanguage' instead"] #-} -- | Converts an t'GI.HarfBuzz.Structs.LanguageT.LanguageT' to an @/hb_tag_t/@. -- -- /Since: 0.6.0/ otTagFromLanguage :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.LanguageT.LanguageT -- ^ /@language@/: an t'GI.HarfBuzz.Structs.LanguageT.LanguageT' to convert. -> m Word32 otTagFromLanguage :: forall (m :: * -> *). (HasCallStack, MonadIO m) => LanguageT -> m Word32 otTagFromLanguage LanguageT language = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do language' <- LanguageT -> IO (Ptr LanguageT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr LanguageT language result <- hb_ot_tag_from_language language' touchManagedPtr language return result -- function ot_shape_plan_get_feature_tags -- Args: [ Arg -- { argCName = "shape_plan" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "shape_plan_t" } -- , argCType = Just "hb_shape_plan_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A shaping plan" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of first feature to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "tag_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of features to return;\n Output = the actual number of features returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "tags" -- , argType = TCArray False (-1) 2 (TBasicType TUInt32) -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The array of enabled feature" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "tag_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of features to return;\n Output = the actual number of features returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_shape_plan_get_feature_tags" :: Ptr HarfBuzz.ShapePlanT.ShapePlanT -> -- shape_plan : TInterface (Name {namespace = "HarfBuzz", name = "shape_plan_t"}) Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- tag_count : TBasicType TUInt Ptr (Ptr Word32) -> -- tags : TCArray False (-1) 2 (TBasicType TUInt32) IO Word32 -- | Fetches the list of OpenType feature tags enabled for a shaping plan, if possible. -- -- /Since: 10.3.0/ otShapePlanGetFeatureTags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.ShapePlanT.ShapePlanT -- ^ /@shapePlan@/: A shaping plan -> Word32 -- ^ /@startOffset@/: The index of first feature to retrieve -> m ((Word32, [Word32])) -- ^ __Returns:__ Total number of feature tagss. otShapePlanGetFeatureTags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ShapePlanT -> Word32 -> m (Word32, [Word32]) otShapePlanGetFeatureTags ShapePlanT shapePlan Word32 startOffset = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do shapePlan' <- ShapePlanT -> IO (Ptr ShapePlanT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr ShapePlanT shapePlan tagCount <- allocMem :: IO (Ptr Word32) tags <- callocMem :: IO (Ptr (Ptr Word32)) result <- hb_ot_shape_plan_get_feature_tags shapePlan' startOffset tagCount tags tagCount' <- peek tagCount tags' <- peek tags tags'' <- (unpackStorableArrayWithLength tagCount') tags' freeMem tags' touchManagedPtr shapePlan freeMem tagCount freeMem tags return (result, tags'') -- function ot_shape_plan_collect_lookups -- XXX Could not generate function ot_shape_plan_collect_lookups -- Not implemented: Don't know how to allocate "lookup_indexes" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) -- function ot_shape_glyphs_closure -- XXX Could not generate function ot_shape_glyphs_closure -- Not implemented: Don't know how to allocate "glyphs" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) -- function ot_name_list_names -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "font face." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_entries" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "number of returned entries." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "num_entries" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "number of returned entries." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just -- (TCArray -- False -- (-1) -- 1 -- (TInterface -- Name { namespace = "HarfBuzz" , name = "ot_name_entry_t" })) -- throws : False -- Skip return : False foreign import ccall "hb_ot_name_list_names" hb_ot_name_list_names :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Ptr Word32 -> -- num_entries : TBasicType TUInt IO (Ptr HarfBuzz.OtNameEntryT.OtNameEntryT) -- | Enumerates all available name IDs and language combinations. Returned -- array is owned by the /@face@/ and should not be modified. It can be -- used as long as /@face@/ is alive. -- -- /Since: 2.1.0/ otNameListNames :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: font face. -> m [HarfBuzz.OtNameEntryT.OtNameEntryT] -- ^ __Returns:__ Array of available name entries. otNameListNames :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m [OtNameEntryT] otNameListNames FaceT face = IO [OtNameEntryT] -> m [OtNameEntryT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [OtNameEntryT] -> m [OtNameEntryT]) -> IO [OtNameEntryT] -> m [OtNameEntryT] forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face numEntries <- allocMem :: IO (Ptr Word32) result <- hb_ot_name_list_names face' numEntries numEntries' <- peek numEntries checkUnexpectedReturnNULL "otNameListNames" result result' <- (unpackBlockArrayWithLength 12 numEntries') result result'' <- mapM (newPtr HarfBuzz.OtNameEntryT.OtNameEntryT) result' touchManagedPtr face freeMem numEntries return result'' -- function ot_name_get_utf8 -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "font face." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name_id" -- , argType = TBasicType TUInt -- , argCType = Just "hb_ot_name_id_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "OpenType name identifier to fetch." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "language to fetch the name for." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "input size of @text buffer, and output size of\n text written to buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "text" -- , argType = TCArray False (-1) 3 (TBasicType TUTF8) -- , argCType = Just "char*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "buffer to write fetched name into." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "text_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "input size of @text buffer, and output size of\n text written to buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_name_get_utf8" hb_ot_name_get_utf8 :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- name_id : TBasicType TUInt Ptr HarfBuzz.LanguageT.LanguageT -> -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) Word32 -> -- text_size : TBasicType TUInt Ptr CString -> -- text : TCArray False (-1) 3 (TBasicType TUTF8) IO Word32 -- | Fetches a font name from the OpenType \'name\' table. -- If /@language@/ is 'GI.HarfBuzz.Constants.LANGUAGE_INVALID', English (\"en\") is assumed. -- Returns string in UTF-8 encoding. A NUL terminator is always written -- for convenience, and isn\'t included in the output /@textSize@/. -- -- /Since: 2.1.0/ otNameGetUtf8 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: font face. -> Word32 -- ^ /@nameId@/: OpenType name identifier to fetch. -> HarfBuzz.LanguageT.LanguageT -- ^ /@language@/: language to fetch the name for. -> [T.Text] -- ^ /@text@/: buffer to write fetched name into. -> m ((Word32, [T.Text])) -- ^ __Returns:__ full length of the requested string, or 0 if not found. otNameGetUtf8 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> LanguageT -> [Text] -> m (Word32, [Text]) otNameGetUtf8 FaceT face Word32 nameId LanguageT language [Text] text = IO (Word32, [Text]) -> m (Word32, [Text]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Text]) -> m (Word32, [Text])) -> IO (Word32, [Text]) -> m (Word32, [Text]) forall a b. (a -> b) -> a -> b $ do let textSize :: Word32 textSize = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Text] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Text] text face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face language' <- unsafeManagedPtrGetPtr language text' <- packUTF8CArray text result <- hb_ot_name_get_utf8 face' nameId language' textSize text' text'' <- (unpackUTF8CArrayWithLength textSize) text' (mapCArrayWithLength textSize) freeMem text' freeMem text' touchManagedPtr face touchManagedPtr language return (result, text'') -- function ot_name_get_utf32 -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "font face." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name_id" -- , argType = TBasicType TUInt -- , argCType = Just "hb_ot_name_id_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "OpenType name identifier to fetch." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "language to fetch the name for." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "input size of @text buffer, and output size of\n text written to buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "text" -- , argType = TCArray False (-1) 3 (TBasicType TUInt32) -- , argCType = Just "uint32_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "buffer to write fetched name into." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "text_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "input size of @text buffer, and output size of\n text written to buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_name_get_utf32" hb_ot_name_get_utf32 :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- name_id : TBasicType TUInt Ptr HarfBuzz.LanguageT.LanguageT -> -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) Word32 -> -- text_size : TBasicType TUInt Ptr Word32 -> -- text : TCArray False (-1) 3 (TBasicType TUInt32) IO Word32 -- | Fetches a font name from the OpenType \'name\' table. -- If /@language@/ is 'GI.HarfBuzz.Constants.LANGUAGE_INVALID', English (\"en\") is assumed. -- Returns string in UTF-32 encoding. A NUL terminator is always written -- for convenience, and isn\'t included in the output /@textSize@/. -- -- /Since: 2.1.0/ otNameGetUtf32 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: font face. -> Word32 -- ^ /@nameId@/: OpenType name identifier to fetch. -> HarfBuzz.LanguageT.LanguageT -- ^ /@language@/: language to fetch the name for. -> [Word32] -- ^ /@text@/: buffer to write fetched name into. -> m ((Word32, [Word32])) -- ^ __Returns:__ full length of the requested string, or 0 if not found. otNameGetUtf32 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> LanguageT -> [Word32] -> m (Word32, [Word32]) otNameGetUtf32 FaceT face Word32 nameId LanguageT language [Word32] text = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do let textSize :: Word32 textSize = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Word32] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Word32] text face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face language' <- unsafeManagedPtrGetPtr language text' <- packStorableArray text result <- hb_ot_name_get_utf32 face' nameId language' textSize text' text'' <- (unpackStorableArrayWithLength textSize) text' freeMem text' touchManagedPtr face touchManagedPtr language return (result, text'') -- function ot_name_get_utf16 -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "font face." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name_id" -- , argType = TBasicType TUInt -- , argCType = Just "hb_ot_name_id_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "OpenType name identifier to fetch." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "language to fetch the name for." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "input size of @text buffer, and output size of\n text written to buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "text" -- , argType = TCArray False (-1) 3 (TBasicType TUInt16) -- , argCType = Just "uint16_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "buffer to write fetched name into." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "text_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "input size of @text buffer, and output size of\n text written to buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_name_get_utf16" hb_ot_name_get_utf16 :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- name_id : TBasicType TUInt Ptr HarfBuzz.LanguageT.LanguageT -> -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) Word32 -> -- text_size : TBasicType TUInt Ptr Word16 -> -- text : TCArray False (-1) 3 (TBasicType TUInt16) IO Word32 -- | Fetches a font name from the OpenType \'name\' table. -- If /@language@/ is 'GI.HarfBuzz.Constants.LANGUAGE_INVALID', English (\"en\") is assumed. -- Returns string in UTF-16 encoding. A NUL terminator is always written -- for convenience, and isn\'t included in the output /@textSize@/. -- -- /Since: 2.1.0/ otNameGetUtf16 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: font face. -> Word32 -- ^ /@nameId@/: OpenType name identifier to fetch. -> HarfBuzz.LanguageT.LanguageT -- ^ /@language@/: language to fetch the name for. -> [Word16] -- ^ /@text@/: buffer to write fetched name into. -> m ((Word32, [Word16])) -- ^ __Returns:__ full length of the requested string, or 0 if not found. otNameGetUtf16 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> LanguageT -> [Word16] -> m (Word32, [Word16]) otNameGetUtf16 FaceT face Word32 nameId LanguageT language [Word16] text = IO (Word32, [Word16]) -> m (Word32, [Word16]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word16]) -> m (Word32, [Word16])) -> IO (Word32, [Word16]) -> m (Word32, [Word16]) forall a b. (a -> b) -> a -> b $ do let textSize :: Word32 textSize = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Word16] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Word16] text face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face language' <- unsafeManagedPtrGetPtr language text' <- packStorableArray text result <- hb_ot_name_get_utf16 face' nameId language' textSize text' text'' <- (unpackStorableArrayWithLength textSize) text' freeMem text' touchManagedPtr face touchManagedPtr language return (result, text'') -- function ot_metrics_get_y_variation -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_font_t object." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "metrics_tag" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_metrics_tag_t" } -- , argCType = Just "hb_ot_metrics_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "tag of metrics value you like to fetch." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_ot_metrics_get_y_variation" hb_ot_metrics_get_y_variation :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- metrics_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_metrics_tag_t"}) IO Int32 -- | Fetches vertical metrics value corresponding to /@metricsTag@/ from /@font@/ with -- the current font variation settings applied. -- -- /Since: 2.6.0/ otMetricsGetYVariation :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' object. -> [HarfBuzz.Flags.OtMetricsTagT] -- ^ /@metricsTag@/: tag of metrics value you like to fetch. -> m Int32 -- ^ __Returns:__ The requested metric value. otMetricsGetYVariation :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [OtMetricsTagT] -> m Int32 otMetricsGetYVariation FontT font [OtMetricsTagT] metricsTag = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let metricsTag' = [OtMetricsTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [OtMetricsTagT] metricsTag result <- hb_ot_metrics_get_y_variation font' metricsTag' touchManagedPtr font return result -- function ot_metrics_get_x_variation -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_font_t object." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "metrics_tag" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_metrics_tag_t" } -- , argCType = Just "hb_ot_metrics_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "tag of metrics value you like to fetch." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_ot_metrics_get_x_variation" hb_ot_metrics_get_x_variation :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- metrics_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_metrics_tag_t"}) IO Int32 -- | Fetches horizontal metrics value corresponding to /@metricsTag@/ from /@font@/ -- with the current font variation settings applied. -- -- /Since: 2.6.0/ otMetricsGetXVariation :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' object. -> [HarfBuzz.Flags.OtMetricsTagT] -- ^ /@metricsTag@/: tag of metrics value you like to fetch. -> m Int32 -- ^ __Returns:__ The requested metric value. otMetricsGetXVariation :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [OtMetricsTagT] -> m Int32 otMetricsGetXVariation FontT font [OtMetricsTagT] metricsTag = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let metricsTag' = [OtMetricsTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [OtMetricsTagT] metricsTag result <- hb_ot_metrics_get_x_variation font' metricsTag' touchManagedPtr font return result -- function ot_metrics_get_variation -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_font_t object." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "metrics_tag" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_metrics_tag_t" } -- , argCType = Just "hb_ot_metrics_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "tag of metrics value you like to fetch." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TFloat) -- throws : False -- Skip return : False foreign import ccall "hb_ot_metrics_get_variation" hb_ot_metrics_get_variation :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- metrics_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_metrics_tag_t"}) IO CFloat -- | Fetches metrics value corresponding to /@metricsTag@/ from /@font@/ with the -- current font variation settings applied. -- -- /Since: 2.6.0/ otMetricsGetVariation :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' object. -> [HarfBuzz.Flags.OtMetricsTagT] -- ^ /@metricsTag@/: tag of metrics value you like to fetch. -> m Float -- ^ __Returns:__ The requested metric value. otMetricsGetVariation :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [OtMetricsTagT] -> m Float otMetricsGetVariation FontT font [OtMetricsTagT] metricsTag = IO Float -> m Float forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Float -> m Float) -> IO Float -> m Float forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let metricsTag' = [OtMetricsTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [OtMetricsTagT] metricsTag result <- hb_ot_metrics_get_variation font' metricsTag' let result' = CFloat -> Float forall a b. (Real a, Fractional b) => a -> b realToFrac CFloat result touchManagedPtr font return result' -- function ot_metrics_get_position_with_fallback -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_font_t object." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "metrics_tag" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_metrics_tag_t" } -- , argCType = Just "hb_ot_metrics_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "tag of metrics value you like to fetch." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "position" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "result of metrics value from the font." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_ot_metrics_get_position_with_fallback" hb_ot_metrics_get_position_with_fallback :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- metrics_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_metrics_tag_t"}) Ptr Int32 -> -- position : TBasicType TInt32 IO () -- | Fetches metrics value corresponding to /@metricsTag@/ from /@font@/, -- and synthesizes a value if it the value is missing in the font. -- -- /Since: 4.0.0/ otMetricsGetPositionWithFallback :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' object. -> [HarfBuzz.Flags.OtMetricsTagT] -- ^ /@metricsTag@/: tag of metrics value you like to fetch. -> m (Int32) otMetricsGetPositionWithFallback :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [OtMetricsTagT] -> m Int32 otMetricsGetPositionWithFallback FontT font [OtMetricsTagT] metricsTag = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let metricsTag' = [OtMetricsTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [OtMetricsTagT] metricsTag position <- allocMem :: IO (Ptr Int32) hb_ot_metrics_get_position_with_fallback font' metricsTag' position position' <- peek position touchManagedPtr font freeMem position return position' -- function ot_metrics_get_position -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_font_t object." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "metrics_tag" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_metrics_tag_t" } -- , argCType = Just "hb_ot_metrics_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "tag of metrics value you like to fetch." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "position" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "result of metrics value from the font." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_metrics_get_position" hb_ot_metrics_get_position :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- metrics_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_metrics_tag_t"}) Ptr Int32 -> -- position : TBasicType TInt32 IO Int32 -- | Fetches metrics value corresponding to /@metricsTag@/ from /@font@/. -- -- /Since: 2.6.0/ otMetricsGetPosition :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' object. -> [HarfBuzz.Flags.OtMetricsTagT] -- ^ /@metricsTag@/: tag of metrics value you like to fetch. -> m ((Int32, Int32)) -- ^ __Returns:__ Whether found the requested metrics in the font. otMetricsGetPosition :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [OtMetricsTagT] -> m (Int32, Int32) otMetricsGetPosition FontT font [OtMetricsTagT] metricsTag = IO (Int32, Int32) -> m (Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32) -> m (Int32, Int32)) -> IO (Int32, Int32) -> m (Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let metricsTag' = [OtMetricsTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [OtMetricsTagT] metricsTag position <- allocMem :: IO (Ptr Int32) result <- hb_ot_metrics_get_position font' metricsTag' position position' <- peek position touchManagedPtr font freeMem position return (result, position') -- function ot_meta_reference_entry -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #hb_face_t object." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "meta_tag" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "ot_meta_tag_t" } -- , argCType = Just "hb_ot_meta_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "tag of metadata you like to have." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ot_meta_reference_entry" hb_ot_meta_reference_entry :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) CUInt -> -- meta_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_meta_tag_t"}) IO (Ptr HarfBuzz.BlobT.BlobT) -- | It fetches metadata entry of a given tag from a font. -- -- /Since: 2.6.0/ otMetaReferenceEntry :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: a t'GI.HarfBuzz.Structs.FaceT.FaceT' object. -> [HarfBuzz.Flags.OtMetaTagT] -- ^ /@metaTag@/: tag of metadata you like to have. -> m HarfBuzz.BlobT.BlobT -- ^ __Returns:__ A blob containing the blob. otMetaReferenceEntry :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> [OtMetaTagT] -> m BlobT otMetaReferenceEntry FaceT face [OtMetaTagT] metaTag = IO BlobT -> m BlobT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face let metaTag' = [OtMetaTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [OtMetaTagT] metaTag result <- hb_ot_meta_reference_entry face' metaTag' checkUnexpectedReturnNULL "otMetaReferenceEntry" result result' <- (wrapBoxed HarfBuzz.BlobT.BlobT) result touchManagedPtr face return result' -- function ot_meta_get_entry_tags -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "iteration's start offset" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "entries_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "buffer size as input, filled size as output" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "entries" -- , argType = -- TCArray -- False -- (-1) -- 2 -- (TInterface -- Name { namespace = "HarfBuzz" , name = "ot_meta_tag_t" }) -- , argCType = Just "hb_ot_meta_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "entries tags buffer" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "entries_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "buffer size as input, filled size as output" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_meta_get_entry_tags" :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- start_offset : TBasicType TUInt Word32 -> -- entries_count : TBasicType TUInt Ptr CUInt -> -- entries : TCArray False (-1) 2 (TInterface (Name {namespace = "HarfBuzz", name = "ot_meta_tag_t"})) IO Word32 -- | Fetches all available feature types. -- -- /Since: 2.6.0/ otMetaGetEntryTags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: a face object -> Word32 -- ^ /@startOffset@/: iteration\'s start offset -> [[HarfBuzz.Flags.OtMetaTagT]] -- ^ /@entries@/: entries tags buffer -> m ((Word32, [[HarfBuzz.Flags.OtMetaTagT]])) -- ^ __Returns:__ Number of all available feature types. otMetaGetEntryTags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> [[OtMetaTagT]] -> m (Word32, [[OtMetaTagT]]) otMetaGetEntryTags FaceT face Word32 startOffset [[OtMetaTagT]] entries = IO (Word32, [[OtMetaTagT]]) -> m (Word32, [[OtMetaTagT]]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [[OtMetaTagT]]) -> m (Word32, [[OtMetaTagT]])) -> IO (Word32, [[OtMetaTagT]]) -> m (Word32, [[OtMetaTagT]]) forall a b. (a -> b) -> a -> b $ do let entriesCount :: Word32 entriesCount = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [[OtMetaTagT]] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [[OtMetaTagT]] entries face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face let entries' = ([OtMetaTagT] -> CUInt) -> [[OtMetaTagT]] -> [CUInt] forall a b. (a -> b) -> [a] -> [b] map [OtMetaTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [[OtMetaTagT]] entries entries'' <- packStorableArray entries' result <- hb_ot_meta_get_entry_tags face' startOffset entriesCount entries'' entries''' <- (unpackStorableArrayWithLength entriesCount) entries'' let entries'''' = (CUInt -> [OtMetaTagT]) -> [CUInt] -> [[OtMetaTagT]] forall a b. (a -> b) -> [a] -> [b] map CUInt -> [OtMetaTagT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags [CUInt] entries''' freeMem entries'' touchManagedPtr face return (result, entries'''') -- function ot_math_is_glyph_extended_shape -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph index to test" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_math_is_glyph_extended_shape" hb_ot_math_is_glyph_extended_shape :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Tests whether the given glyph index is an extended shape in the face. -- -- /Since: 1.3.3/ otMathIsGlyphExtendedShape :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@glyph@/: The glyph index to test -> m Int32 -- ^ __Returns:__ @true@ if the glyph is an extended shape, @false@ otherwise otMathIsGlyphExtendedShape :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m Int32 otMathIsGlyphExtendedShape FaceT face Word32 glyph = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_math_is_glyph_extended_shape face' glyph touchManagedPtr face return result -- function ot_math_has_data -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to test" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_math_has_data" hb_ot_math_has_data :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether a face has a @MATH@ table. -- -- /Since: 1.3.3/ otMathHasData :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to test -> m Int32 -- ^ __Returns:__ @true@ if the table is found, @false@ otherwise otMathHasData :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 otMathHasData FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_math_has_data face' touchManagedPtr face return result -- function ot_math_get_min_connector_overlap -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "direction of the stretching (horizontal or vertical)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_ot_math_get_min_connector_overlap" hb_ot_math_get_min_connector_overlap :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) IO Int32 -- | Fetches the MathVariants table for the specified font and returns the -- minimum overlap of connecting glyphs that are required to draw a glyph -- assembly in the specified direction. -- -- \<note>The /@direction@/ parameter is only used to select between horizontal -- or vertical directions for the construction. Even though all t'GI.HarfBuzz.Enums.DirectionT' -- values are accepted, only the result of @/HB_DIRECTION_IS_HORIZONTAL/@ is -- considered.\<\/note> -- -- /Since: 1.3.3/ otMathGetMinConnectorOverlap :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: direction of the stretching (horizontal or vertical) -> m Int32 -- ^ __Returns:__ requested minimum connector overlap or zero otMathGetMinConnectorOverlap :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> DirectionT -> m Int32 otMathGetMinConnectorOverlap FontT font DirectionT direction = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction result <- hb_ot_math_get_min_connector_overlap font' direction' touchManagedPtr font return result -- function ot_math_get_glyph_variants -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the glyph to stretch" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The direction of the stretching (horizontal or vertical)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first variant to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "variants_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of variants to return;\n Output = the actual number of variants returned" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "variants" -- , argType = -- TCArray -- False -- (-1) -- 4 -- (TInterface -- Name { namespace = "HarfBuzz" , name = "ot_math_glyph_variant_t" }) -- , argCType = Just "hb_ot_math_glyph_variant_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "array of variants returned" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "variants_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of variants to return;\n Output = the actual number of variants returned" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_math_get_glyph_variants" hb_ot_math_get_glyph_variants :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Word32 -> -- start_offset : TBasicType TUInt Word32 -> -- variants_count : TBasicType TUInt Ptr HarfBuzz.OtMathGlyphVariantT.OtMathGlyphVariantT -> -- variants : TCArray False (-1) 4 (TInterface (Name {namespace = "HarfBuzz", name = "ot_math_glyph_variant_t"})) IO Word32 -- | Fetches the MathGlyphConstruction for the specified font, glyph index, and -- direction. The corresponding list of size variants is returned as a list of -- t'GI.HarfBuzz.Structs.OtMathGlyphVariantT.OtMathGlyphVariantT' structs. -- -- \<note>The /@direction@/ parameter is only used to select between horizontal -- or vertical directions for the construction. Even though all t'GI.HarfBuzz.Enums.DirectionT' -- values are accepted, only the result of @/HB_DIRECTION_IS_HORIZONTAL/@ is -- considered.\<\/note> -- -- /Since: 1.3.3/ otMathGetGlyphVariants :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The index of the glyph to stretch -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The direction of the stretching (horizontal or vertical) -> Word32 -- ^ /@startOffset@/: offset of the first variant to retrieve -> [HarfBuzz.OtMathGlyphVariantT.OtMathGlyphVariantT] -- ^ /@variants@/: array of variants returned -> m ((Word32, [HarfBuzz.OtMathGlyphVariantT.OtMathGlyphVariantT])) -- ^ __Returns:__ the total number of size variants available or zero otMathGetGlyphVariants :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> DirectionT -> Word32 -> [OtMathGlyphVariantT] -> m (Word32, [OtMathGlyphVariantT]) otMathGetGlyphVariants FontT font Word32 glyph DirectionT direction Word32 startOffset [OtMathGlyphVariantT] variants = IO (Word32, [OtMathGlyphVariantT]) -> m (Word32, [OtMathGlyphVariantT]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [OtMathGlyphVariantT]) -> m (Word32, [OtMathGlyphVariantT])) -> IO (Word32, [OtMathGlyphVariantT]) -> m (Word32, [OtMathGlyphVariantT]) forall a b. (a -> b) -> a -> b $ do let variantsCount :: Word32 variantsCount = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [OtMathGlyphVariantT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [OtMathGlyphVariantT] variants font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction variants' <- mapM B.ManagedPtr.disownBoxed variants variants'' <- packBlockArray 8 variants' result <- hb_ot_math_get_glyph_variants font' glyph direction' startOffset variantsCount variants'' variants''' <- (unpackBoxedArrayWithLength 8 variantsCount) variants'' variants'''' <- mapM (wrapBoxed HarfBuzz.OtMathGlyphVariantT.OtMathGlyphVariantT) variants''' freeMem variants'' touchManagedPtr font mapM_ touchManagedPtr variants return (result, variants'''') -- function ot_math_get_glyph_top_accent_attachment -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The glyph index from which to retrieve the value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_ot_math_get_glyph_top_accent_attachment" hb_ot_math_get_glyph_top_accent_attachment :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Fetches a top-accent-attachment value (if one exists) for the specified -- glyph index. -- -- For any glyph that does not have a top-accent-attachment value - that is, -- a glyph not covered by the @MathTopAccentAttachment@ table (or, when -- /@font@/ has no @MathTopAccentAttachment@ table or no @MATH@ table, any -- glyph) - the function synthesizes a value, returning the position at -- one-half the glyph\'s advance width. -- -- /Since: 1.3.3/ otMathGetGlyphTopAccentAttachment :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph index from which to retrieve the value -> m Int32 -- ^ __Returns:__ the top accent attachment of the glyph or 0.5 * the advance -- width of /@glyph@/ otMathGetGlyphTopAccentAttachment :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m Int32 otMathGetGlyphTopAccentAttachment FontT font Word32 glyph = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_ot_math_get_glyph_top_accent_attachment font' glyph touchManagedPtr font return result -- function ot_math_get_glyph_kernings -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The glyph index from which to retrieve the kernings" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "kern" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_math_kern_t" } -- , argCType = Just "hb_ot_math_kern_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The #hb_ot_math_kern_t from which to retrieve the kernings" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first kern entry to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "entries_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of kern entries to return;\n Output = the actual number of kern entries returned" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "kern_entries" -- , argType = -- TCArray -- False -- (-1) -- 4 -- (TInterface -- Name { namespace = "HarfBuzz" , name = "ot_math_kern_entry_t" }) -- , argCType = Just "hb_ot_math_kern_entry_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "array of kern entries returned" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "entries_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of kern entries to return;\n Output = the actual number of kern entries returned" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_math_get_glyph_kernings" hb_ot_math_get_glyph_kernings :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 CUInt -> -- kern : TInterface (Name {namespace = "HarfBuzz", name = "ot_math_kern_t"}) Word32 -> -- start_offset : TBasicType TUInt Word32 -> -- entries_count : TBasicType TUInt Ptr HarfBuzz.OtMathKernEntryT.OtMathKernEntryT -> -- kern_entries : TCArray False (-1) 4 (TInterface (Name {namespace = "HarfBuzz", name = "ot_math_kern_entry_t"})) IO Word32 -- | Fetches the raw MathKern (cut-in) data for the specified font, glyph index, -- and /@kern@/. The corresponding list of kern values and correction heights is -- returned as a list of t'GI.HarfBuzz.Structs.OtMathKernEntryT.OtMathKernEntryT' structs. -- -- See also @/hb_ot_math_get_glyph_kerning/@, which handles selecting the -- appropriate kern value for a given correction height. -- -- \<note>For a glyph with /@n@/ defined kern values (where /@n@/ > 0), there are only -- /@n@/−1 defined correction heights, as each correction height defines a boundary -- past which the next kern value should be selected. Therefore, only the -- t'GI.HarfBuzz.Structs.OtMathKernEntryT.OtMathKernEntryT'.@/kern_value/@ of the uppermost t'GI.HarfBuzz.Structs.OtMathKernEntryT.OtMathKernEntryT' -- actually comes from the font; its corresponding -- t'GI.HarfBuzz.Structs.OtMathKernEntryT.OtMathKernEntryT'.@/max_correction_height/@ is always set to -- \<code>INT32_MAX\<\/code>.\<\/note> -- -- /Since: 3.4.0/ otMathGetGlyphKernings :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph index from which to retrieve the kernings -> HarfBuzz.Enums.OtMathKernT -- ^ /@kern@/: The t'GI.HarfBuzz.Enums.OtMathKernT' from which to retrieve the kernings -> Word32 -- ^ /@startOffset@/: offset of the first kern entry to retrieve -> [HarfBuzz.OtMathKernEntryT.OtMathKernEntryT] -- ^ /@kernEntries@/: array of kern entries returned -> m ((Word32, [HarfBuzz.OtMathKernEntryT.OtMathKernEntryT])) -- ^ __Returns:__ the total number of kern values available or zero otMathGetGlyphKernings :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> OtMathKernT -> Word32 -> [OtMathKernEntryT] -> m (Word32, [OtMathKernEntryT]) otMathGetGlyphKernings FontT font Word32 glyph OtMathKernT kern Word32 startOffset [OtMathKernEntryT] kernEntries = IO (Word32, [OtMathKernEntryT]) -> m (Word32, [OtMathKernEntryT]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [OtMathKernEntryT]) -> m (Word32, [OtMathKernEntryT])) -> IO (Word32, [OtMathKernEntryT]) -> m (Word32, [OtMathKernEntryT]) forall a b. (a -> b) -> a -> b $ do let entriesCount :: Word32 entriesCount = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [OtMathKernEntryT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [OtMathKernEntryT] kernEntries font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let kern' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (OtMathKernT -> Int) -> OtMathKernT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . OtMathKernT -> Int forall a. Enum a => a -> Int fromEnum) OtMathKernT kern kernEntries' <- mapM unsafeManagedPtrGetPtr kernEntries kernEntries'' <- packBlockArray 8 kernEntries' result <- hb_ot_math_get_glyph_kernings font' glyph kern' startOffset entriesCount kernEntries'' kernEntries''' <- (unpackBlockArrayWithLength 8 entriesCount) kernEntries'' kernEntries'''' <- mapM (wrapPtr HarfBuzz.OtMathKernEntryT.OtMathKernEntryT) kernEntries''' freeMem kernEntries'' touchManagedPtr font mapM_ touchManagedPtr kernEntries return (result, kernEntries'''') -- function ot_math_get_glyph_kerning -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The glyph index from which to retrieve the value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "kern" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_math_kern_t" } -- , argCType = Just "hb_ot_math_kern_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The #hb_ot_math_kern_t from which to retrieve the value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "correction_height" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the correction height to use to determine the kerning." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_ot_math_get_glyph_kerning" hb_ot_math_get_glyph_kerning :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 CUInt -> -- kern : TInterface (Name {namespace = "HarfBuzz", name = "ot_math_kern_t"}) Int32 -> -- correction_height : TBasicType TInt32 IO Int32 -- | Fetches the math kerning (cut-ins) value for the specified font, glyph index, and -- /@kern@/. -- -- If the MathKern table is found, the function examines it to find a height -- value that is greater or equal to /@correctionHeight@/. If such a height -- value is found, corresponding kerning value from the table is returned. If -- no such height value is found, the last kerning value is returned. -- -- /Since: 1.3.3/ otMathGetGlyphKerning :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph index from which to retrieve the value -> HarfBuzz.Enums.OtMathKernT -- ^ /@kern@/: The t'GI.HarfBuzz.Enums.OtMathKernT' from which to retrieve the value -> Int32 -- ^ /@correctionHeight@/: the correction height to use to determine the kerning. -> m Int32 -- ^ __Returns:__ requested kerning value or zero otMathGetGlyphKerning :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> OtMathKernT -> Int32 -> m Int32 otMathGetGlyphKerning FontT font Word32 glyph OtMathKernT kern Int32 correctionHeight = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let kern' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (OtMathKernT -> Int) -> OtMathKernT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . OtMathKernT -> Int forall a. Enum a => a -> Int fromEnum) OtMathKernT kern result <- hb_ot_math_get_glyph_kerning font' glyph kern' correctionHeight touchManagedPtr font return result -- function ot_math_get_glyph_italics_correction -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The glyph index from which to retrieve the value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_ot_math_get_glyph_italics_correction" hb_ot_math_get_glyph_italics_correction :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Fetches an italics-correction value (if one exists) for the specified -- glyph index. -- -- /Since: 1.3.3/ otMathGetGlyphItalicsCorrection :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph index from which to retrieve the value -> m Int32 -- ^ __Returns:__ the italics correction of the glyph or zero otMathGetGlyphItalicsCorrection :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m Int32 otMathGetGlyphItalicsCorrection FontT font Word32 glyph = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_ot_math_get_glyph_italics_correction font' glyph touchManagedPtr font return result -- function ot_math_get_glyph_assembly -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the glyph to stretch" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "direction of the stretching (horizontal or vertical)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first glyph part to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "parts_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = maximum number of glyph parts to return;\n Output = actual number of parts returned" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "parts" -- , argType = -- TCArray -- False -- (-1) -- 4 -- (TInterface -- Name { namespace = "HarfBuzz" , name = "ot_math_glyph_part_t" }) -- , argCType = Just "hb_ot_math_glyph_part_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the glyph parts returned" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "italics_correction" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "italics correction of the glyph assembly" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "parts_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = maximum number of glyph parts to return;\n Output = actual number of parts returned" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_math_get_glyph_assembly" hb_ot_math_get_glyph_assembly :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Word32 -> -- start_offset : TBasicType TUInt Word32 -> -- parts_count : TBasicType TUInt Ptr HarfBuzz.OtMathGlyphPartT.OtMathGlyphPartT -> -- parts : TCArray False (-1) 4 (TInterface (Name {namespace = "HarfBuzz", name = "ot_math_glyph_part_t"})) Ptr Int32 -> -- italics_correction : TBasicType TInt32 IO Word32 -- | Fetches the GlyphAssembly for the specified font, glyph index, and direction. -- Returned are a list of t'GI.HarfBuzz.Structs.OtMathGlyphPartT.OtMathGlyphPartT' glyph parts that can be -- used to draw the glyph and an italics-correction value (if one is defined -- in the font). -- -- \<note>The /@direction@/ parameter is only used to select between horizontal -- or vertical directions for the construction. Even though all t'GI.HarfBuzz.Enums.DirectionT' -- values are accepted, only the result of @/HB_DIRECTION_IS_HORIZONTAL/@ is -- considered.\<\/note> -- -- /Since: 1.3.3/ otMathGetGlyphAssembly :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The index of the glyph to stretch -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: direction of the stretching (horizontal or vertical) -> Word32 -- ^ /@startOffset@/: offset of the first glyph part to retrieve -> [HarfBuzz.OtMathGlyphPartT.OtMathGlyphPartT] -- ^ /@parts@/: the glyph parts returned -> m ((Word32, [HarfBuzz.OtMathGlyphPartT.OtMathGlyphPartT], Int32)) -- ^ __Returns:__ the total number of parts in the glyph assembly otMathGetGlyphAssembly :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> DirectionT -> Word32 -> [OtMathGlyphPartT] -> m (Word32, [OtMathGlyphPartT], Int32) otMathGetGlyphAssembly FontT font Word32 glyph DirectionT direction Word32 startOffset [OtMathGlyphPartT] parts = IO (Word32, [OtMathGlyphPartT], Int32) -> m (Word32, [OtMathGlyphPartT], Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [OtMathGlyphPartT], Int32) -> m (Word32, [OtMathGlyphPartT], Int32)) -> IO (Word32, [OtMathGlyphPartT], Int32) -> m (Word32, [OtMathGlyphPartT], Int32) forall a b. (a -> b) -> a -> b $ do let partsCount :: Word32 partsCount = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [OtMathGlyphPartT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [OtMathGlyphPartT] parts font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction parts' <- mapM B.ManagedPtr.disownBoxed parts parts'' <- packBlockArray 20 parts' italicsCorrection <- allocMem :: IO (Ptr Int32) result <- hb_ot_math_get_glyph_assembly font' glyph direction' startOffset partsCount parts'' italicsCorrection parts''' <- (unpackBoxedArrayWithLength 20 partsCount) parts'' parts'''' <- mapM (wrapBoxed HarfBuzz.OtMathGlyphPartT.OtMathGlyphPartT) parts''' freeMem parts'' italicsCorrection' <- peek italicsCorrection touchManagedPtr font mapM_ touchManagedPtr parts freeMem italicsCorrection return (result, parts'''', italicsCorrection') -- function ot_math_get_constant -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "constant" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_math_constant_t" } -- , argCType = Just "hb_ot_math_constant_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "#hb_ot_math_constant_t the constant to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_ot_math_get_constant" hb_ot_math_get_constant :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- constant : TInterface (Name {namespace = "HarfBuzz", name = "ot_math_constant_t"}) IO Int32 -- | Fetches the specified math constant. For most constants, the value returned -- is an @/hb_position_t/@. -- -- However, if the requested constant is @/HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN/@, -- @/HB_OT_MATH_CONSTANT_SCRIPT_SCRIPT_PERCENT_SCALE_DOWN/@ or -- @/HB_OT_MATH_CONSTANT_RADICAL_DEGREE_BOTTOM_RAISE_PERCENT/@, then the return value is -- an integer between 0 and 100 representing that percentage. -- -- /Since: 1.3.3/ otMathGetConstant :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> HarfBuzz.Enums.OtMathConstantT -- ^ /@constant@/: t'GI.HarfBuzz.Enums.OtMathConstantT' the constant to retrieve -> m Int32 -- ^ __Returns:__ the requested constant or zero otMathGetConstant :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> OtMathConstantT -> m Int32 otMathGetConstant FontT font OtMathConstantT constant = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let constant' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (OtMathConstantT -> Int) -> OtMathConstantT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . OtMathConstantT -> Int forall a. Enum a => a -> Int fromEnum) OtMathConstantT constant result <- hb_ot_math_get_constant font' constant' touchManagedPtr font return result -- function ot_layout_table_select_script -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Number of script tags in the array" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_tags" -- , argType = TBasicType TUInt32 -- , argCType = Just "const hb_tag_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Array of #hb_tag_t script tags" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested script" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "chosen_script" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_tag_t of the requested script" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_table_select_script" hb_ot_layout_table_select_script :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_count : TBasicType TUInt Word32 -> -- script_tags : TBasicType TUInt32 Ptr Word32 -> -- script_index : TBasicType TUInt Ptr Word32 -> -- chosen_script : TBasicType TUInt32 IO Int32 -- | Selects an OpenType script for /@tableTag@/ from the /@scriptTags@/ array. -- -- If the table does not have any of the requested scripts, then @DFLT@, -- @dflt@, and @latn@ tags are tried in that order. If the table still does not -- have any of these scripts, /@scriptIndex@/ is set to -- 'GI.HarfBuzz.Constants.OT_LAYOUT_NO_SCRIPT_INDEX' and /@chosenScript@/ is set to @/HB_TAG_NONE/@. -- -- /Since: 2.0.0/ otLayoutTableSelectScript :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptCount@/: Number of script tags in the array -> Word32 -- ^ /@scriptTags@/: Array of @/hb_tag_t/@ script tags -> m ((Int32, Word32, Word32)) -- ^ __Returns:__ @true@ if one of the requested scripts is selected, @false@ if a fallback -- script is selected or if no scripts are selected. otLayoutTableSelectScript :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> m (Int32, Word32, Word32) otLayoutTableSelectScript FaceT face Word32 tableTag Word32 scriptCount Word32 scriptTags = IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32)) -> IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face scriptIndex <- allocMem :: IO (Ptr Word32) chosenScript <- allocMem :: IO (Ptr Word32) result <- hb_ot_layout_table_select_script face' tableTag scriptCount scriptTags scriptIndex chosenScript scriptIndex' <- peek scriptIndex chosenScript' <- peek chosenScript touchManagedPtr face freeMem scriptIndex freeMem chosenScript return (result, scriptIndex', chosenScript') -- function ot_layout_table_get_script_tags -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first script tag to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of script tags to return;\n Output = the actual number of script tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "script_tags" -- , argType = TCArray False (-1) 3 (TBasicType TUInt32) -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The array of #hb_tag_t script tags found for the query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "script_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of script tags to return;\n Output = the actual number of script tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_table_get_script_tags" :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- script_count : TBasicType TUInt Ptr (Ptr Word32) -> -- script_tags : TCArray False (-1) 3 (TBasicType TUInt32) IO Word32 -- | Fetches a list of all scripts enumerated in the specified face\'s GSUB table -- or GPOS table. The list returned will begin at the offset provided. otLayoutTableGetScriptTags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@startOffset@/: offset of the first script tag to retrieve -> m ((Word32, [Word32])) -- ^ __Returns:__ Total number of script tags. otLayoutTableGetScriptTags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> m (Word32, [Word32]) otLayoutTableGetScriptTags FaceT face Word32 tableTag Word32 startOffset = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face scriptCount <- allocMem :: IO (Ptr Word32) scriptTags <- callocMem :: IO (Ptr (Ptr Word32)) result <- hb_ot_layout_table_get_script_tags face' tableTag startOffset scriptCount scriptTags scriptCount' <- peek scriptCount scriptTags' <- peek scriptTags scriptTags'' <- (unpackStorableArrayWithLength scriptCount') scriptTags' freeMem scriptTags' touchManagedPtr face freeMem scriptCount freeMem scriptTags return (result, scriptTags'') -- function ot_layout_table_get_lookup_count -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_table_get_lookup_count" hb_ot_layout_table_get_lookup_count :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 IO Word32 -- | Fetches the total number of lookups enumerated in the specified -- face\'s GSUB table or GPOS table. -- -- /Since: 0.9.22/ otLayoutTableGetLookupCount :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> m Word32 -- ^ __Returns:__ Total number of lookups. otLayoutTableGetLookupCount :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m Word32 otLayoutTableGetLookupCount FaceT face Word32 tableTag = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_layout_table_get_lookup_count face' tableTag touchManagedPtr face return result -- function ot_layout_table_get_feature_tags -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first feature tag to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of feature tags to return;\n Output = the actual number of feature tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "feature_tags" -- , argType = TCArray False (-1) 3 (TBasicType TUInt32) -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Array of feature tags found in the table" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "feature_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of feature tags to return;\n Output = the actual number of feature tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_table_get_feature_tags" :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- feature_count : TBasicType TUInt Ptr (Ptr Word32) -> -- feature_tags : TCArray False (-1) 3 (TBasicType TUInt32) IO Word32 -- | Fetches a list of all feature tags in the given face\'s GSUB or GPOS table. -- Note that there might be duplicate feature tags, belonging to different -- script\/language-system pairs of the table. -- -- /Since: 0.6.0/ otLayoutTableGetFeatureTags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@startOffset@/: offset of the first feature tag to retrieve -> m ((Word32, [Word32])) -- ^ __Returns:__ Total number of feature tags. otLayoutTableGetFeatureTags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> m (Word32, [Word32]) otLayoutTableGetFeatureTags FaceT face Word32 tableTag Word32 startOffset = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face featureCount <- allocMem :: IO (Ptr Word32) featureTags <- callocMem :: IO (Ptr (Ptr Word32)) result <- hb_ot_layout_table_get_feature_tags face' tableTag startOffset featureCount featureTags featureCount' <- peek featureCount featureTags' <- peek featureTags featureTags'' <- (unpackStorableArrayWithLength featureCount') featureTags' freeMem featureTags' touchManagedPtr face freeMem featureCount freeMem featureTags return (result, featureTags'') -- function ot_layout_table_find_script -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_tag_t of the script tag requested" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested script tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_table_find_script" hb_ot_layout_table_find_script :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_tag : TBasicType TUInt32 Ptr Word32 -> -- script_index : TBasicType TUInt IO Int32 -- | Fetches the index if a given script tag in the specified face\'s GSUB table -- or GPOS table. otLayoutTableFindScript :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptTag@/: @/hb_tag_t/@ of the script tag requested -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if the script is found, @false@ otherwise otLayoutTableFindScript :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> m (Int32, Word32) otLayoutTableFindScript FaceT face Word32 tableTag Word32 scriptTag = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face scriptIndex <- allocMem :: IO (Ptr Word32) result <- hb_ot_layout_table_find_script face' tableTag scriptTag scriptIndex scriptIndex' <- peek scriptIndex touchManagedPtr face freeMem scriptIndex return (result, scriptIndex') -- function ot_layout_table_find_feature_variations -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coords" -- , argType = TBasicType TInt -- , argCType = Just "const int*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The variation coordinates to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "num_coords" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of variation coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "variations_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The array of feature variations found for the query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_table_find_feature_variations" hb_ot_layout_table_find_feature_variations :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Int32 -> -- coords : TBasicType TInt Word32 -> -- num_coords : TBasicType TUInt Ptr Word32 -> -- variations_index : TBasicType TUInt IO Int32 -- | Fetches a list of feature variations in the specified face\'s GSUB table -- or GPOS table, at the specified variation coordinates. -- -- /Since: 1.4.0/ otLayoutTableFindFeatureVariations :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Int32 -- ^ /@coords@/: The variation coordinates to query -> Word32 -- ^ /@numCoords@/: The number of variation coordinates -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if feature variations were found, @false@ otherwise. otLayoutTableFindFeatureVariations :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Int32 -> Word32 -> m (Int32, Word32) otLayoutTableFindFeatureVariations FaceT face Word32 tableTag Int32 coords Word32 numCoords = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face variationsIndex <- allocMem :: IO (Ptr Word32) result <- hb_ot_layout_table_find_feature_variations face' tableTag coords numCoords variationsIndex variationsIndex' <- peek variationsIndex touchManagedPtr face freeMem variationsIndex return (result, variationsIndex') -- function ot_layout_table_choose_script -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_tags" -- , argType = TBasicType TUInt32 -- , argCType = Just "const hb_tag_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Array of #hb_tag_t script tags" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the chosen script" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "chosen_script" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_tag_t of the chosen script" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_table_choose_script" hb_ot_layout_table_choose_script :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_tags : TBasicType TUInt32 Ptr Word32 -> -- script_index : TBasicType TUInt Ptr Word32 -> -- chosen_script : TBasicType TUInt32 IO Int32 -- | Deprecated since 2.0.0 otLayoutTableChooseScript :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptTags@/: Array of @/hb_tag_t/@ script tags -> m ((Int32, Word32, Word32)) otLayoutTableChooseScript :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> m (Int32, Word32, Word32) otLayoutTableChooseScript FaceT face Word32 tableTag Word32 scriptTags = IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32)) -> IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face scriptIndex <- allocMem :: IO (Ptr Word32) chosenScript <- allocMem :: IO (Ptr Word32) result <- hb_ot_layout_table_choose_script face' tableTag scriptTags scriptIndex chosenScript scriptIndex' <- peek scriptIndex chosenScript' <- peek chosenScript touchManagedPtr face freeMem scriptIndex freeMem chosenScript return (result, scriptIndex', chosenScript') -- function ot_layout_script_select_language2 -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested script tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The number of languages in the specified script" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_tags" -- , argType = TBasicType TUInt32 -- , argCType = Just "const hb_tag_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The array of language tags" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the chosen language" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "chosen_language" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_tag_t of the chosen language" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_script_select_language2" hb_ot_layout_script_select_language2 :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_index : TBasicType TUInt Word32 -> -- language_count : TBasicType TUInt Word32 -> -- language_tags : TBasicType TUInt32 Ptr Word32 -> -- language_index : TBasicType TUInt Ptr Word32 -> -- chosen_language : TBasicType TUInt32 IO Int32 -- | Fetches the index of the first language tag fom /@languageTags@/ that is present -- in the specified face\'s GSUB or GPOS table, underneath the specified script -- index. -- -- If none of the given language tags is found, @false@ is returned and -- /@languageIndex@/ is set to 'GI.HarfBuzz.Constants.OT_LAYOUT_DEFAULT_LANGUAGE_INDEX' and -- /@chosenLanguage@/ is set to @/HB_TAG_NONE/@. -- -- /Since: 7.0.0/ otLayoutScriptSelectLanguage2 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptIndex@/: The index of the requested script tag -> Word32 -- ^ /@languageCount@/: The number of languages in the specified script -> Word32 -- ^ /@languageTags@/: The array of language tags -> m ((Int32, Word32, Word32)) -- ^ __Returns:__ @true@ if one of the given language tags is found, @false@ otherwise otLayoutScriptSelectLanguage2 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> Word32 -> m (Int32, Word32, Word32) otLayoutScriptSelectLanguage2 FaceT face Word32 tableTag Word32 scriptIndex Word32 languageCount Word32 languageTags = IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32)) -> IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face languageIndex <- allocMem :: IO (Ptr Word32) chosenLanguage <- allocMem :: IO (Ptr Word32) result <- hb_ot_layout_script_select_language2 face' tableTag scriptIndex languageCount languageTags languageIndex chosenLanguage languageIndex' <- peek languageIndex chosenLanguage' <- peek chosenLanguage touchManagedPtr face freeMem languageIndex freeMem chosenLanguage return (result, languageIndex', chosenLanguage') -- function ot_layout_script_select_language -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested script tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The number of languages in the specified script" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_tags" -- , argType = TBasicType TUInt32 -- , argCType = Just "const hb_tag_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The array of language tags" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested language" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_script_select_language" hb_ot_layout_script_select_language :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_index : TBasicType TUInt Word32 -> -- language_count : TBasicType TUInt Word32 -> -- language_tags : TBasicType TUInt32 Ptr Word32 -> -- language_index : TBasicType TUInt IO Int32 -- | Fetches the index of the first language tag fom /@languageTags@/ that is present -- in the specified face\'s GSUB or GPOS table, underneath the specified script -- index. -- -- If none of the given language tags is found, @false@ is returned and -- /@languageIndex@/ is set to the default language index. -- -- /Since: 2.0.0/ otLayoutScriptSelectLanguage :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptIndex@/: The index of the requested script tag -> Word32 -- ^ /@languageCount@/: The number of languages in the specified script -> Word32 -- ^ /@languageTags@/: The array of language tags -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if one of the given language tags is found, @false@ otherwise otLayoutScriptSelectLanguage :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> Word32 -> m (Int32, Word32) otLayoutScriptSelectLanguage FaceT face Word32 tableTag Word32 scriptIndex Word32 languageCount Word32 languageTags = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face languageIndex <- allocMem :: IO (Ptr Word32) result <- hb_ot_layout_script_select_language face' tableTag scriptIndex languageCount languageTags languageIndex languageIndex' <- peek languageIndex touchManagedPtr face freeMem languageIndex return (result, languageIndex') -- function ot_layout_script_get_language_tags -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested script tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first language tag to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of language tags to return;\n Output = the actual number of language tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "language_tags" -- , argType = TCArray False (-1) 4 (TBasicType TUInt32) -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Array of language tags found in the table" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "language_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of language tags to return;\n Output = the actual number of language tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_script_get_language_tags" :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_index : TBasicType TUInt Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- language_count : TBasicType TUInt Ptr (Ptr Word32) -> -- language_tags : TCArray False (-1) 4 (TBasicType TUInt32) IO Word32 -- | Fetches a list of language tags in the given face\'s GSUB or GPOS table, underneath -- the specified script index. The list returned will begin at the offset provided. -- -- /Since: 0.6.0/ otLayoutScriptGetLanguageTags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptIndex@/: The index of the requested script tag -> Word32 -- ^ /@startOffset@/: offset of the first language tag to retrieve -> m ((Word32, [Word32])) -- ^ __Returns:__ Total number of language tags. otLayoutScriptGetLanguageTags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> m (Word32, [Word32]) otLayoutScriptGetLanguageTags FaceT face Word32 tableTag Word32 scriptIndex Word32 startOffset = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face languageCount <- allocMem :: IO (Ptr Word32) languageTags <- callocMem :: IO (Ptr (Ptr Word32)) result <- hb_ot_layout_script_get_language_tags face' tableTag scriptIndex startOffset languageCount languageTags languageCount' <- peek languageCount languageTags' <- peek languageTags languageTags'' <- (unpackStorableArrayWithLength languageCount') languageTags' freeMem languageTags' touchManagedPtr face freeMem languageCount freeMem languageTags return (result, languageTags'') -- function ot_layout_script_find_language -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested script tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_tag_t of the requested language" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested language" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_script_find_language" hb_ot_layout_script_find_language :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_index : TBasicType TUInt Word32 -> -- language_tag : TBasicType TUInt32 Word32 -> -- language_index : TBasicType TUInt IO Int32 {-# DEPRECATED otLayoutScriptFindLanguage ["(Since version 2.0.0)"] #-} -- | Fetches the index of a given language tag in the specified face\'s GSUB table -- or GPOS table, underneath the specified script tag. -- -- /Since: 0.6.0/ otLayoutScriptFindLanguage :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptIndex@/: The index of the requested script tag -> Word32 -- ^ /@languageTag@/: The @/hb_tag_t/@ of the requested language -> Word32 -- ^ /@languageIndex@/: The index of the requested language -> m Int32 -- ^ __Returns:__ @true@ if the language tag is found, @false@ otherwise otLayoutScriptFindLanguage :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> Word32 -> m Int32 otLayoutScriptFindLanguage FaceT face Word32 tableTag Word32 scriptIndex Word32 languageTag Word32 languageIndex = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_layout_script_find_language face' tableTag scriptIndex languageTag languageIndex touchManagedPtr face return result -- function ot_layout_lookups_substitute_closure -- XXX Could not generate function ot_layout_lookups_substitute_closure -- Not implemented: Don't know how to allocate "glyphs" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) -- function ot_layout_lookup_would_substitute -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "lookup_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the lookup to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyphs" -- , argType = TBasicType TUInt32 -- , argCType = Just "const hb_codepoint_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The sequence of glyphs to query for substitution" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyphs_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The length of the glyph sequence" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "zero_context" -- , argType = TBasicType TInt -- , argCType = Just "hb_bool_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "#hb_bool_t indicating whether pre-/post-context are disallowed\nin substitutions" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_lookup_would_substitute" hb_ot_layout_lookup_would_substitute :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- lookup_index : TBasicType TUInt Word32 -> -- glyphs : TBasicType TUInt32 Word32 -> -- glyphs_length : TBasicType TUInt Int32 -> -- zero_context : TBasicType TInt IO Int32 -- | Tests whether a specified lookup in the specified face would -- trigger a substitution on the given glyph sequence. -- -- /Since: 0.9.7/ otLayoutLookupWouldSubstitute :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@lookupIndex@/: The index of the lookup to query -> Word32 -- ^ /@glyphs@/: The sequence of glyphs to query for substitution -> Word32 -- ^ /@glyphsLength@/: The length of the glyph sequence -> Int32 -- ^ /@zeroContext@/: @/hb_bool_t/@ indicating whether pre-\/post-context are disallowed -- in substitutions -> m Int32 -- ^ __Returns:__ @true@ if a substitution would be triggered, @false@ otherwise otLayoutLookupWouldSubstitute :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> Int32 -> m Int32 otLayoutLookupWouldSubstitute FaceT face Word32 lookupIndex Word32 glyphs Word32 glyphsLength Int32 zeroContext = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_layout_lookup_would_substitute face' lookupIndex glyphs glyphsLength zeroContext touchManagedPtr face return result -- function ot_layout_lookup_substitute_closure -- XXX Could not generate function ot_layout_lookup_substitute_closure -- Not implemented: Don't know how to allocate "glyphs" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) -- function ot_layout_lookup_get_optical_bound -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a font." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "lookup_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "index of the feature lookup to query." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "edge of the glyph to query." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a glyph id." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_lookup_get_optical_bound" hb_ot_layout_lookup_get_optical_bound :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- lookup_index : TBasicType TUInt CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Fetches the optical bound of a glyph positioned at the margin of text. -- The direction identifies which edge of the glyph to query. -- -- /Since: 5.3.0/ otLayoutLookupGetOpticalBound :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: a font. -> Word32 -- ^ /@lookupIndex@/: index of the feature lookup to query. -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: edge of the glyph to query. -> Word32 -- ^ /@glyph@/: a glyph id. -> m Int32 -- ^ __Returns:__ Adjustment value. Negative values mean the glyph will stick out of the margin. otLayoutLookupGetOpticalBound :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> DirectionT -> Word32 -> m Int32 otLayoutLookupGetOpticalBound FontT font Word32 lookupIndex DirectionT direction Word32 glyph = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction result <- hb_ot_layout_lookup_get_optical_bound font' lookupIndex direction' glyph touchManagedPtr font return result -- function ot_layout_lookup_get_glyph_alternates -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a face." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "lookup_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "index of the feature lookup to query." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a glyph id." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "starting offset." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "alternate_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of alternate glyphs to return;\n Output = the actual number of alternate glyphs returned (may be zero)." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "alternate_glyphs" -- , argType = TCArray False (-1) 4 (TBasicType TUInt32) -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "A glyphs buffer.\n Alternate glyphs associated with the glyph id." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "alternate_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of alternate glyphs to return;\n Output = the actual number of alternate glyphs returned (may be zero)." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_lookup_get_glyph_alternates" hb_ot_layout_lookup_get_glyph_alternates :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- lookup_index : TBasicType TUInt Word32 -> -- glyph : TBasicType TUInt32 Word32 -> -- start_offset : TBasicType TUInt Word32 -> -- alternate_count : TBasicType TUInt Ptr Word32 -> -- alternate_glyphs : TCArray False (-1) 4 (TBasicType TUInt32) IO Word32 -- | Fetches alternates of a glyph from a given GSUB lookup index. Note that for one-to-one GSUB -- glyph substitutions, this function fetches the substituted glyph. -- -- /Since: 2.6.8/ otLayoutLookupGetGlyphAlternates :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: a face. -> Word32 -- ^ /@lookupIndex@/: index of the feature lookup to query. -> Word32 -- ^ /@glyph@/: a glyph id. -> Word32 -- ^ /@startOffset@/: starting offset. -> [Word32] -- ^ /@alternateGlyphs@/: A glyphs buffer. -- Alternate glyphs associated with the glyph id. -> m ((Word32, [Word32])) -- ^ __Returns:__ Total number of alternates found in the specific lookup index for the given glyph id. otLayoutLookupGetGlyphAlternates :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> [Word32] -> m (Word32, [Word32]) otLayoutLookupGetGlyphAlternates FaceT face Word32 lookupIndex Word32 glyph Word32 startOffset [Word32] alternateGlyphs = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do let alternateCount :: Word32 alternateCount = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Word32] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Word32] alternateGlyphs face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face alternateGlyphs' <- packStorableArray alternateGlyphs result <- hb_ot_layout_lookup_get_glyph_alternates face' lookupIndex glyph startOffset alternateCount alternateGlyphs' alternateGlyphs'' <- (unpackStorableArrayWithLength alternateCount) alternateGlyphs' freeMem alternateGlyphs' touchManagedPtr face return (result, alternateGlyphs'') -- function ot_layout_lookup_collect_glyphs -- XXX Could not generate function ot_layout_lookup_collect_glyphs -- Not implemented: Don't know how to allocate "glyphs_before" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) -- function ot_layout_lookup_collect_glyph_alternates -- XXX Could not generate function ot_layout_lookup_collect_glyph_alternates -- Bad introspection data: C type for argument ‘alternate_count’ is not a pointer to a pointer -- function ot_layout_language_get_required_feature_index -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested script tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested language tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested feature" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_language_get_required_feature_index" hb_ot_layout_language_get_required_feature_index :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_index : TBasicType TUInt Word32 -> -- language_index : TBasicType TUInt Ptr Word32 -> -- feature_index : TBasicType TUInt IO Int32 -- | Fetches the index of a requested feature in the given face\'s GSUB or GPOS table, -- underneath the specified script and language. -- -- /Since: 0.6.0/ otLayoutLanguageGetRequiredFeatureIndex :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptIndex@/: The index of the requested script tag -> Word32 -- ^ /@languageIndex@/: The index of the requested language tag -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if the feature is found, @false@ otherwise otLayoutLanguageGetRequiredFeatureIndex :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> m (Int32, Word32) otLayoutLanguageGetRequiredFeatureIndex FaceT face Word32 tableTag Word32 scriptIndex Word32 languageIndex = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face featureIndex <- allocMem :: IO (Ptr Word32) result <- hb_ot_layout_language_get_required_feature_index face' tableTag scriptIndex languageIndex featureIndex featureIndex' <- peek featureIndex touchManagedPtr face freeMem featureIndex return (result, featureIndex') -- function ot_layout_language_get_required_feature -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested script tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested language tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested feature" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "feature_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_tag_t of the requested feature" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_language_get_required_feature" hb_ot_layout_language_get_required_feature :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_index : TBasicType TUInt Word32 -> -- language_index : TBasicType TUInt Ptr Word32 -> -- feature_index : TBasicType TUInt Ptr Word32 -> -- feature_tag : TBasicType TUInt32 IO Int32 -- | Fetches the tag of a requested feature index in the given face\'s GSUB or GPOS table, -- underneath the specified script and language. -- -- /Since: 0.9.30/ otLayoutLanguageGetRequiredFeature :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptIndex@/: The index of the requested script tag -> Word32 -- ^ /@languageIndex@/: The index of the requested language tag -> m ((Int32, Word32, Word32)) -- ^ __Returns:__ @true@ if the feature is found, @false@ otherwise otLayoutLanguageGetRequiredFeature :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> m (Int32, Word32, Word32) otLayoutLanguageGetRequiredFeature FaceT face Word32 tableTag Word32 scriptIndex Word32 languageIndex = IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32)) -> IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face featureIndex <- allocMem :: IO (Ptr Word32) featureTag <- allocMem :: IO (Ptr Word32) result <- hb_ot_layout_language_get_required_feature face' tableTag scriptIndex languageIndex featureIndex featureTag featureIndex' <- peek featureIndex featureTag' <- peek featureTag touchManagedPtr face freeMem featureIndex freeMem featureTag return (result, featureIndex', featureTag') -- function ot_layout_language_get_feature_tags -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested script tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested language tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first feature tag to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of feature tags to return;\n Output = the actual number of feature tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "feature_tags" -- , argType = TCArray False (-1) 5 (TBasicType TUInt32) -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The array of #hb_tag_t feature tags found for the query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "feature_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of feature tags to return;\n Output = the actual number of feature tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_language_get_feature_tags" :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_index : TBasicType TUInt Word32 -> -- language_index : TBasicType TUInt Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- feature_count : TBasicType TUInt Ptr (Ptr Word32) -> -- feature_tags : TCArray False (-1) 5 (TBasicType TUInt32) IO Word32 -- | Fetches a list of all features in the specified face\'s GSUB table -- or GPOS table, underneath the specified script and language. The list -- returned will begin at the offset provided. -- -- /Since: 0.6.0/ otLayoutLanguageGetFeatureTags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptIndex@/: The index of the requested script tag -> Word32 -- ^ /@languageIndex@/: The index of the requested language tag -> Word32 -- ^ /@startOffset@/: offset of the first feature tag to retrieve -> m ((Word32, [Word32])) -- ^ __Returns:__ Total number of feature tags. otLayoutLanguageGetFeatureTags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> Word32 -> m (Word32, [Word32]) otLayoutLanguageGetFeatureTags FaceT face Word32 tableTag Word32 scriptIndex Word32 languageIndex Word32 startOffset = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face featureCount <- allocMem :: IO (Ptr Word32) featureTags <- callocMem :: IO (Ptr (Ptr Word32)) result <- hb_ot_layout_language_get_feature_tags face' tableTag scriptIndex languageIndex startOffset featureCount featureTags featureCount' <- peek featureCount featureTags' <- peek featureTags featureTags'' <- (unpackStorableArrayWithLength featureCount') featureTags' freeMem featureTags' touchManagedPtr face freeMem featureCount freeMem featureTags return (result, featureTags'') -- function ot_layout_language_get_feature_indexes -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested script tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested language tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first feature tag to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of feature tags to return;\n Output: the actual number of feature tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "feature_indexes" -- , argType = TCArray False (-1) 5 (TBasicType TUInt) -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The array of feature indexes found for the query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "feature_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of feature tags to return;\n Output: the actual number of feature tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_language_get_feature_indexes" hb_ot_layout_language_get_feature_indexes :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_index : TBasicType TUInt Word32 -> -- language_index : TBasicType TUInt Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- feature_count : TBasicType TUInt Ptr (Ptr Word32) -> -- feature_indexes : TCArray False (-1) 5 (TBasicType TUInt) IO Word32 -- | Fetches a list of all features in the specified face\'s GSUB table -- or GPOS table, underneath the specified script and language. The list -- returned will begin at the offset provided. -- -- /Since: 0.6.0/ otLayoutLanguageGetFeatureIndexes :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptIndex@/: The index of the requested script tag -> Word32 -- ^ /@languageIndex@/: The index of the requested language tag -> Word32 -- ^ /@startOffset@/: offset of the first feature tag to retrieve -> m ((Word32, [Word32])) -- ^ __Returns:__ Total number of features. otLayoutLanguageGetFeatureIndexes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> Word32 -> m (Word32, [Word32]) otLayoutLanguageGetFeatureIndexes FaceT face Word32 tableTag Word32 scriptIndex Word32 languageIndex Word32 startOffset = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face featureCount <- allocMem :: IO (Ptr Word32) featureIndexes <- callocMem :: IO (Ptr (Ptr Word32)) result <- hb_ot_layout_language_get_feature_indexes face' tableTag scriptIndex languageIndex startOffset featureCount featureIndexes featureCount' <- peek featureCount featureIndexes' <- peek featureIndexes featureIndexes'' <- (unpackStorableArrayWithLength featureCount') featureIndexes' freeMem featureIndexes' touchManagedPtr face freeMem featureCount freeMem featureIndexes return (result, featureIndexes'') -- function ot_layout_language_find_feature -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested script tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested language tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_tag_t of the feature tag requested" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested feature" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_language_find_feature" hb_ot_layout_language_find_feature :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- script_index : TBasicType TUInt Word32 -> -- language_index : TBasicType TUInt Word32 -> -- feature_tag : TBasicType TUInt32 Ptr Word32 -> -- feature_index : TBasicType TUInt IO Int32 -- | Fetches the index of a given feature tag in the specified face\'s GSUB table -- or GPOS table, underneath the specified script and language. -- -- /Since: 0.6.0/ otLayoutLanguageFindFeature :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@scriptIndex@/: The index of the requested script tag -> Word32 -- ^ /@languageIndex@/: The index of the requested language tag -> Word32 -- ^ /@featureTag@/: @/hb_tag_t/@ of the feature tag requested -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if the feature is found, @false@ otherwise otLayoutLanguageFindFeature :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> Word32 -> m (Int32, Word32) otLayoutLanguageFindFeature FaceT face Word32 tableTag Word32 scriptIndex Word32 languageIndex Word32 featureTag = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face featureIndex <- allocMem :: IO (Ptr Word32) result <- hb_ot_layout_language_find_feature face' tableTag scriptIndex languageIndex featureTag featureIndex featureIndex' <- peek featureIndex touchManagedPtr face freeMem featureIndex return (result, featureIndex') -- function ot_layout_has_substitution -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_has_substitution" hb_ot_layout_has_substitution :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether the specified face includes any GSUB substitutions. -- -- /Since: 0.6.0/ otLayoutHasSubstitution :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise otLayoutHasSubstitution :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 otLayoutHasSubstitution FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_layout_has_substitution face' touchManagedPtr face return result -- function ot_layout_has_positioning -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_has_positioning" hb_ot_layout_has_positioning :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether the specified face includes any GPOS positioning. otLayoutHasPositioning :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if the face has GPOS data, @false@ otherwise otLayoutHasPositioning :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 otLayoutHasPositioning FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_layout_has_positioning face' touchManagedPtr face return result -- function ot_layout_has_glyph_classes -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_has_glyph_classes" hb_ot_layout_has_glyph_classes :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether a face has any glyph classes defined in its GDEF table. otLayoutHasGlyphClasses :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise otLayoutHasGlyphClasses :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 otLayoutHasGlyphClasses FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_layout_has_glyph_classes face' touchManagedPtr face return result -- function ot_layout_get_size_params -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "design_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The design size of the face" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "subfamily_id" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The identifier of the face within the font subfamily" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "subfamily_name_id" -- , argType = TBasicType TUInt -- , argCType = Just "hb_ot_name_id_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The \8216name\8217 table name ID of the face within the font subfamily" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "range_start" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The minimum size of the recommended size range for the face" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "range_end" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The maximum size of the recommended size range for the face" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_get_size_params" hb_ot_layout_get_size_params :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Ptr Word32 -> -- design_size : TBasicType TUInt Ptr Word32 -> -- subfamily_id : TBasicType TUInt Ptr Word32 -> -- subfamily_name_id : TBasicType TUInt Ptr Word32 -> -- range_start : TBasicType TUInt Ptr Word32 -> -- range_end : TBasicType TUInt IO Int32 -- | Fetches optical-size feature data (i.e., the @size@ feature from GPOS). Note that -- the subfamily_id and the subfamily name string (accessible via the subfamily_name_id) -- as used here are defined as pertaining only to fonts within a font family that differ -- specifically in their respective size ranges; other ways to differentiate fonts within -- a subfamily are not covered by the @size@ feature. -- -- For more information on this distinction, see the <http://developer.gnome.org/harfbuzz/stable/ -- https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#tag-size `size` feature documentation>. -- -- /Since: 0.9.10/ otLayoutGetSizeParams :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m ((Int32, Word32, Word32, Word32, Word32, Word32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise otLayoutGetSizeParams :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m (Int32, Word32, Word32, Word32, Word32, Word32) otLayoutGetSizeParams FaceT face = IO (Int32, Word32, Word32, Word32, Word32, Word32) -> m (Int32, Word32, Word32, Word32, Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32, Word32, Word32, Word32, Word32) -> m (Int32, Word32, Word32, Word32, Word32, Word32)) -> IO (Int32, Word32, Word32, Word32, Word32, Word32) -> m (Int32, Word32, Word32, Word32, Word32, Word32) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face designSize <- allocMem :: IO (Ptr Word32) subfamilyId <- allocMem :: IO (Ptr Word32) subfamilyNameId <- allocMem :: IO (Ptr Word32) rangeStart <- allocMem :: IO (Ptr Word32) rangeEnd <- allocMem :: IO (Ptr Word32) result <- hb_ot_layout_get_size_params face' designSize subfamilyId subfamilyNameId rangeStart rangeEnd designSize' <- peek designSize subfamilyId' <- peek subfamilyId subfamilyNameId' <- peek subfamilyNameId rangeStart' <- peek rangeStart rangeEnd' <- peek rangeEnd touchManagedPtr face freeMem designSize freeMem subfamilyId freeMem subfamilyNameId freeMem rangeStart freeMem rangeEnd return (result, designSize', subfamilyId', subfamilyNameId', rangeStart', rangeEnd') -- function ot_layout_get_ligature_carets -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_font_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_direction_t text direction to use" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_codepoint_t code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "offset of the first caret position to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "caret_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of caret positions to return;\n Output = the actual number of caret positions returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "caret_array" -- , argType = TCArray False (-1) 4 (TBasicType TInt32) -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The array of caret positions found for the query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "caret_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of caret positions to return;\n Output = the actual number of caret positions returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_get_ligature_carets" hb_ot_layout_get_ligature_carets :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Word32 -> -- glyph : TBasicType TUInt32 Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- caret_count : TBasicType TUInt Ptr (Ptr Int32) -> -- caret_array : TCArray False (-1) 4 (TBasicType TInt32) IO Word32 -- | Fetches a list of the caret positions defined for a ligature glyph in the GDEF -- table of the font. The list returned will begin at the offset provided. -- -- Note that a ligature that is formed from n characters will have n-1 -- caret positions. The first character is not represented in the array, -- since its caret position is the glyph position. -- -- The positions returned by this function are \'unshaped\', and will have to -- be fixed up for kerning that may be applied to the ligature glyph. otLayoutGetLigatureCarets :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: The t'GI.HarfBuzz.Structs.FontT.FontT' to work on -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The t'GI.HarfBuzz.Enums.DirectionT' text direction to use -> Word32 -- ^ /@glyph@/: The @/hb_codepoint_t/@ code point to query -> Word32 -- ^ /@startOffset@/: offset of the first caret position to retrieve -> m ((Word32, [Int32])) -- ^ __Returns:__ Total number of ligature caret positions for /@glyph@/. otLayoutGetLigatureCarets :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> DirectionT -> Word32 -> Word32 -> m (Word32, [Int32]) otLayoutGetLigatureCarets FontT font DirectionT direction Word32 glyph Word32 startOffset = IO (Word32, [Int32]) -> m (Word32, [Int32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Int32]) -> m (Word32, [Int32])) -> IO (Word32, [Int32]) -> m (Word32, [Int32]) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction caretCount <- allocMem :: IO (Ptr Word32) caretArray <- callocMem :: IO (Ptr (Ptr Int32)) result <- hb_ot_layout_get_ligature_carets font' direction' glyph startOffset caretCount caretArray caretCount' <- peek caretCount caretArray' <- peek caretArray caretArray'' <- (unpackStorableArrayWithLength caretCount') caretArray' freeMem caretArray' touchManagedPtr font freeMem caretCount freeMem caretArray return (result, caretArray'') -- function ot_layout_get_horizontal_baseline_tag_for_script -- Args: [ Arg -- { argCName = "script" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "script_t" } -- , argCType = Just "hb_script_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a script tag." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name -- { namespace = "HarfBuzz" , name = "ot_layout_baseline_tag_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_get_horizontal_baseline_tag_for_script" hb_ot_layout_get_horizontal_baseline_tag_for_script :: CUInt -> -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"}) IO CUInt -- | Fetches the dominant horizontal baseline tag used by /@script@/. -- -- /Since: 4.0.0/ otLayoutGetHorizontalBaselineTagForScript :: (B.CallStack.HasCallStack, MonadIO m) => [HarfBuzz.Flags.ScriptT] -- ^ /@script@/: a script tag. -> m [HarfBuzz.Flags.OtLayoutBaselineTagT] -- ^ __Returns:__ dominant baseline tag for the /@script@/. otLayoutGetHorizontalBaselineTagForScript :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [ScriptT] -> m [OtLayoutBaselineTagT] otLayoutGetHorizontalBaselineTagForScript [ScriptT] script = IO [OtLayoutBaselineTagT] -> m [OtLayoutBaselineTagT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [OtLayoutBaselineTagT] -> m [OtLayoutBaselineTagT]) -> IO [OtLayoutBaselineTagT] -> m [OtLayoutBaselineTagT] forall a b. (a -> b) -> a -> b $ do let script' :: CUInt script' = [ScriptT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ScriptT] script result <- CUInt -> IO CUInt hb_ot_layout_get_horizontal_baseline_tag_for_script CUInt script' let result' = CUInt -> [OtLayoutBaselineTagT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result return result' -- function ot_layout_get_glyphs_in_class -- XXX Could not generate function ot_layout_get_glyphs_in_class -- Not implemented: Don't know how to allocate "glyphs" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) -- function ot_layout_get_glyph_class -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_face_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_codepoint_t code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "ot_layout_glyph_class_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_get_glyph_class" hb_ot_layout_get_glyph_class :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- glyph : TBasicType TUInt32 IO CUInt -- | Fetches the GDEF class of the requested glyph in the specified face. -- -- /Since: 0.9.7/ otLayoutGetGlyphClass :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on -> Word32 -- ^ /@glyph@/: The @/hb_codepoint_t/@ code point to query -> m HarfBuzz.Enums.OtLayoutGlyphClassT -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.OtLayoutGlyphClassT' glyph class of the given code -- point in the GDEF table of the face. otLayoutGetGlyphClass :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m OtLayoutGlyphClassT otLayoutGetGlyphClass FaceT face Word32 glyph = IO OtLayoutGlyphClassT -> m OtLayoutGlyphClassT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO OtLayoutGlyphClassT -> m OtLayoutGlyphClassT) -> IO OtLayoutGlyphClassT -> m OtLayoutGlyphClassT forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_layout_get_glyph_class face' glyph let result' = (Int -> OtLayoutGlyphClassT forall a. Enum a => Int -> a toEnum (Int -> OtLayoutGlyphClassT) -> (CUInt -> Int) -> CUInt -> OtLayoutGlyphClassT forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result touchManagedPtr face return result' -- function ot_layout_get_font_extents2 -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a font" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "text direction." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "script_t" } -- , argCType = Just "hb_script_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "script." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "language." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "extents" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "font_extents_t" } -- , argCType = Just "hb_font_extents_t*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "font extents if found." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_get_font_extents2" hb_ot_layout_get_font_extents2 :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) CUInt -> -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"}) Ptr HarfBuzz.LanguageT.LanguageT -> -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) Ptr HarfBuzz.FontExtentsT.FontExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "font_extents_t"}) IO Int32 -- | Fetches script\/language-specific font extents. These values are -- looked up in the @BASE@ table\'s @MinMax@ records. -- -- If no such extents are found, the default extents for the font are -- fetched. As such, the return value of this function can for the -- most part be ignored. Note that the per-script\/language extents -- do not have a line-gap value, and the line-gap is set to zero in -- that case. -- -- This function is like 'GI.HarfBuzz.Functions.otLayoutGetFontExtents' but takes -- t'GI.HarfBuzz.Flags.ScriptT' and t'GI.HarfBuzz.Structs.LanguageT.LanguageT' instead of OpenType @/hb_tag_t/@. -- -- /Since: 8.0.0/ otLayoutGetFontExtents2 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: a font -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: text direction. -> [HarfBuzz.Flags.ScriptT] -- ^ /@script@/: script. -> Maybe (HarfBuzz.LanguageT.LanguageT) -- ^ /@language@/: language. -> m ((Int32, Maybe HarfBuzz.FontExtentsT.FontExtentsT)) -- ^ __Returns:__ @true@ if found script\/language-specific font extents. otLayoutGetFontExtents2 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> DirectionT -> [ScriptT] -> Maybe LanguageT -> m (Int32, Maybe FontExtentsT) otLayoutGetFontExtents2 FontT font DirectionT direction [ScriptT] script Maybe LanguageT language = IO (Int32, Maybe FontExtentsT) -> m (Int32, Maybe FontExtentsT) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Maybe FontExtentsT) -> m (Int32, Maybe FontExtentsT)) -> IO (Int32, Maybe FontExtentsT) -> m (Int32, Maybe FontExtentsT) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction let script' = [ScriptT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ScriptT] script maybeLanguage <- case language of Maybe LanguageT Nothing -> Ptr LanguageT -> IO (Ptr LanguageT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr LanguageT forall a. Ptr a FP.nullPtr Just LanguageT jLanguage -> do jLanguage' <- LanguageT -> IO (Ptr LanguageT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr LanguageT jLanguage return jLanguage' extents <- SP.callocBytes 48 :: IO (Ptr HarfBuzz.FontExtentsT.FontExtentsT) result <- hb_ot_layout_get_font_extents2 font' direction' script' maybeLanguage extents maybeExtents <- convertIfNonNull extents $ \Ptr FontExtentsT extents' -> do extents'' <- ((ManagedPtr FontExtentsT -> FontExtentsT) -> Ptr FontExtentsT -> IO FontExtentsT forall a. (HasCallStack, BoxedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapPtr ManagedPtr FontExtentsT -> FontExtentsT HarfBuzz.FontExtentsT.FontExtentsT) Ptr FontExtentsT extents' return extents'' touchManagedPtr font whenJust language touchManagedPtr return (result, maybeExtents) -- function ot_layout_get_font_extents -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a font" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "text direction." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "script tag." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "language tag." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "extents" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "font_extents_t" } -- , argCType = Just "hb_font_extents_t*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "font extents if found." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_get_font_extents" hb_ot_layout_get_font_extents :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Word32 -> -- script_tag : TBasicType TUInt32 Word32 -> -- language_tag : TBasicType TUInt32 Ptr HarfBuzz.FontExtentsT.FontExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "font_extents_t"}) IO Int32 -- | Fetches script\/language-specific font extents. These values are -- looked up in the @BASE@ table\'s @MinMax@ records. -- -- If no such extents are found, the default extents for the font are -- fetched. As such, the return value of this function can for the -- most part be ignored. Note that the per-script\/language extents -- do not have a line-gap value, and the line-gap is set to zero in -- that case. -- -- /Since: 8.0.0/ otLayoutGetFontExtents :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: a font -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: text direction. -> Word32 -- ^ /@scriptTag@/: script tag. -> Word32 -- ^ /@languageTag@/: language tag. -> m ((Int32, Maybe HarfBuzz.FontExtentsT.FontExtentsT)) -- ^ __Returns:__ @true@ if found script\/language-specific font extents. otLayoutGetFontExtents :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> DirectionT -> Word32 -> Word32 -> m (Int32, Maybe FontExtentsT) otLayoutGetFontExtents FontT font DirectionT direction Word32 scriptTag Word32 languageTag = IO (Int32, Maybe FontExtentsT) -> m (Int32, Maybe FontExtentsT) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Maybe FontExtentsT) -> m (Int32, Maybe FontExtentsT)) -> IO (Int32, Maybe FontExtentsT) -> m (Int32, Maybe FontExtentsT) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction extents <- SP.callocBytes 48 :: IO (Ptr HarfBuzz.FontExtentsT.FontExtentsT) result <- hb_ot_layout_get_font_extents font' direction' scriptTag languageTag extents maybeExtents <- convertIfNonNull extents $ \Ptr FontExtentsT extents' -> do extents'' <- ((ManagedPtr FontExtentsT -> FontExtentsT) -> Ptr FontExtentsT -> IO FontExtentsT forall a. (HasCallStack, BoxedPtr a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapPtr ManagedPtr FontExtentsT -> FontExtentsT HarfBuzz.FontExtentsT.FontExtentsT) Ptr FontExtentsT extents' return extents'' touchManagedPtr font return (result, maybeExtents) -- function ot_layout_get_baseline_with_fallback2 -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a font" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "baseline_tag" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_layout_baseline_tag_t" } -- , argCType = Just "hb_ot_layout_baseline_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a baseline tag" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "text direction." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "script_t" } -- , argCType = Just "hb_script_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "script." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "language, currently unused." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coord" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "baseline value if found." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_get_baseline_with_fallback2" hb_ot_layout_get_baseline_with_fallback2 :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- baseline_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_layout_baseline_tag_t"}) CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) CUInt -> -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"}) Ptr HarfBuzz.LanguageT.LanguageT -> -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) Ptr Int32 -> -- coord : TBasicType TInt32 IO () -- | Fetches a baseline value from the face, and synthesizes -- it if the font does not have it. -- -- This function is like 'GI.HarfBuzz.Functions.otLayoutGetBaselineWithFallback' but takes -- t'GI.HarfBuzz.Flags.ScriptT' and t'GI.HarfBuzz.Structs.LanguageT.LanguageT' instead of OpenType @/hb_tag_t/@. -- -- /Since: 8.0.0/ otLayoutGetBaselineWithFallback2 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: a font -> [HarfBuzz.Flags.OtLayoutBaselineTagT] -- ^ /@baselineTag@/: a baseline tag -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: text direction. -> [HarfBuzz.Flags.ScriptT] -- ^ /@script@/: script. -> Maybe (HarfBuzz.LanguageT.LanguageT) -- ^ /@language@/: language, currently unused. -> m (Int32) otLayoutGetBaselineWithFallback2 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [OtLayoutBaselineTagT] -> DirectionT -> [ScriptT] -> Maybe LanguageT -> m Int32 otLayoutGetBaselineWithFallback2 FontT font [OtLayoutBaselineTagT] baselineTag DirectionT direction [ScriptT] script Maybe LanguageT language = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let baselineTag' = [OtLayoutBaselineTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [OtLayoutBaselineTagT] baselineTag let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction let script' = [ScriptT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ScriptT] script maybeLanguage <- case language of Maybe LanguageT Nothing -> Ptr LanguageT -> IO (Ptr LanguageT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr LanguageT forall a. Ptr a FP.nullPtr Just LanguageT jLanguage -> do jLanguage' <- LanguageT -> IO (Ptr LanguageT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr LanguageT jLanguage return jLanguage' coord <- allocMem :: IO (Ptr Int32) hb_ot_layout_get_baseline_with_fallback2 font' baselineTag' direction' script' maybeLanguage coord coord' <- peek coord touchManagedPtr font whenJust language touchManagedPtr freeMem coord return coord' -- function ot_layout_get_baseline_with_fallback -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a font" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "baseline_tag" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_layout_baseline_tag_t" } -- , argCType = Just "hb_ot_layout_baseline_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a baseline tag" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "text direction." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "script tag." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "language tag, currently unused." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coord" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "baseline value if found." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_get_baseline_with_fallback" hb_ot_layout_get_baseline_with_fallback :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- baseline_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_layout_baseline_tag_t"}) CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Word32 -> -- script_tag : TBasicType TUInt32 Word32 -> -- language_tag : TBasicType TUInt32 Ptr Int32 -> -- coord : TBasicType TInt32 IO () -- | Fetches a baseline value from the face, and synthesizes -- it if the font does not have it. -- -- /Since: 4.0.0/ otLayoutGetBaselineWithFallback :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: a font -> [HarfBuzz.Flags.OtLayoutBaselineTagT] -- ^ /@baselineTag@/: a baseline tag -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: text direction. -> Word32 -- ^ /@scriptTag@/: script tag. -> Word32 -- ^ /@languageTag@/: language tag, currently unused. -> m (Int32) otLayoutGetBaselineWithFallback :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [OtLayoutBaselineTagT] -> DirectionT -> Word32 -> Word32 -> m Int32 otLayoutGetBaselineWithFallback FontT font [OtLayoutBaselineTagT] baselineTag DirectionT direction Word32 scriptTag Word32 languageTag = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let baselineTag' = [OtLayoutBaselineTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [OtLayoutBaselineTagT] baselineTag let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction coord <- allocMem :: IO (Ptr Int32) hb_ot_layout_get_baseline_with_fallback font' baselineTag' direction' scriptTag languageTag coord coord' <- peek coord touchManagedPtr font freeMem coord return coord' -- function ot_layout_get_baseline2 -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a font" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "baseline_tag" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_layout_baseline_tag_t" } -- , argCType = Just "hb_ot_layout_baseline_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a baseline tag" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "text direction." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "script_t" } -- , argCType = Just "hb_script_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "script." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "language, currently unused." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coord" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "baseline value if found." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_get_baseline2" hb_ot_layout_get_baseline2 :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- baseline_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_layout_baseline_tag_t"}) CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) CUInt -> -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"}) Ptr HarfBuzz.LanguageT.LanguageT -> -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) Ptr Int32 -> -- coord : TBasicType TInt32 IO Int32 -- | Fetches a baseline value from the face. -- -- This function is like 'GI.HarfBuzz.Functions.otLayoutGetBaseline' but takes -- t'GI.HarfBuzz.Flags.ScriptT' and t'GI.HarfBuzz.Structs.LanguageT.LanguageT' instead of OpenType @/hb_tag_t/@. -- -- /Since: 8.0.0/ otLayoutGetBaseline2 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: a font -> [HarfBuzz.Flags.OtLayoutBaselineTagT] -- ^ /@baselineTag@/: a baseline tag -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: text direction. -> [HarfBuzz.Flags.ScriptT] -- ^ /@script@/: script. -> Maybe (HarfBuzz.LanguageT.LanguageT) -- ^ /@language@/: language, currently unused. -> m ((Int32, Int32)) -- ^ __Returns:__ @true@ if found baseline value in the font. otLayoutGetBaseline2 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [OtLayoutBaselineTagT] -> DirectionT -> [ScriptT] -> Maybe LanguageT -> m (Int32, Int32) otLayoutGetBaseline2 FontT font [OtLayoutBaselineTagT] baselineTag DirectionT direction [ScriptT] script Maybe LanguageT language = IO (Int32, Int32) -> m (Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32) -> m (Int32, Int32)) -> IO (Int32, Int32) -> m (Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let baselineTag' = [OtLayoutBaselineTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [OtLayoutBaselineTagT] baselineTag let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction let script' = [ScriptT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ScriptT] script maybeLanguage <- case language of Maybe LanguageT Nothing -> Ptr LanguageT -> IO (Ptr LanguageT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr LanguageT forall a. Ptr a FP.nullPtr Just LanguageT jLanguage -> do jLanguage' <- LanguageT -> IO (Ptr LanguageT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr LanguageT jLanguage return jLanguage' coord <- allocMem :: IO (Ptr Int32) result <- hb_ot_layout_get_baseline2 font' baselineTag' direction' script' maybeLanguage coord coord' <- peek coord touchManagedPtr font whenJust language touchManagedPtr freeMem coord return (result, coord') -- function ot_layout_get_baseline -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a font" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "baseline_tag" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "ot_layout_baseline_tag_t" } -- , argCType = Just "hb_ot_layout_baseline_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a baseline tag" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "text direction." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "script tag." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "language tag, currently unused." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coord" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "baseline value if found." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_get_baseline" hb_ot_layout_get_baseline :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- baseline_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_layout_baseline_tag_t"}) CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Word32 -> -- script_tag : TBasicType TUInt32 Word32 -> -- language_tag : TBasicType TUInt32 Ptr Int32 -> -- coord : TBasicType TInt32 IO Int32 -- | Fetches a baseline value from the face. -- -- /Since: 2.6.0/ otLayoutGetBaseline :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: a font -> [HarfBuzz.Flags.OtLayoutBaselineTagT] -- ^ /@baselineTag@/: a baseline tag -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: text direction. -> Word32 -- ^ /@scriptTag@/: script tag. -> Word32 -- ^ /@languageTag@/: language tag, currently unused. -> m ((Int32, Int32)) -- ^ __Returns:__ @true@ if found baseline value in the font. otLayoutGetBaseline :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [OtLayoutBaselineTagT] -> DirectionT -> Word32 -> Word32 -> m (Int32, Int32) otLayoutGetBaseline FontT font [OtLayoutBaselineTagT] baselineTag DirectionT direction Word32 scriptTag Word32 languageTag = IO (Int32, Int32) -> m (Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32) -> m (Int32, Int32)) -> IO (Int32, Int32) -> m (Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let baselineTag' = [OtLayoutBaselineTagT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [OtLayoutBaselineTagT] baselineTag let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction coord <- allocMem :: IO (Ptr Int32) result <- hb_ot_layout_get_baseline font' baselineTag' direction' scriptTag languageTag coord coord' <- peek coord touchManagedPtr font freeMem coord return (result, coord') -- function ot_layout_get_attach_points -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_face_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_codepoint_t code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "offset of the first attachment point to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "point_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of attachment points to return;\n Output = the actual number of attachment points returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "point_array" -- , argType = TCArray False (-1) 3 (TBasicType TUInt) -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The array of attachment points found for the query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "point_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of attachment points to return;\n Output = the actual number of attachment points returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_get_attach_points" hb_ot_layout_get_attach_points :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- glyph : TBasicType TUInt32 Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- point_count : TBasicType TUInt Ptr (Ptr Word32) -> -- point_array : TCArray False (-1) 3 (TBasicType TUInt) IO Word32 -- | Fetches a list of all attachment points for the specified glyph in the GDEF -- table of the face. The list returned will begin at the offset provided. -- -- Useful if the client program wishes to cache the list. otLayoutGetAttachPoints :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on -> Word32 -- ^ /@glyph@/: The @/hb_codepoint_t/@ code point to query -> Word32 -- ^ /@startOffset@/: offset of the first attachment point to retrieve -> m ((Word32, [Word32])) -- ^ __Returns:__ Total number of attachment points for /@glyph@/. otLayoutGetAttachPoints :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> m (Word32, [Word32]) otLayoutGetAttachPoints FaceT face Word32 glyph Word32 startOffset = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face pointCount <- allocMem :: IO (Ptr Word32) pointArray <- callocMem :: IO (Ptr (Ptr Word32)) result <- hb_ot_layout_get_attach_points face' glyph startOffset pointCount pointArray pointCount' <- peek pointCount pointArray' <- peek pointArray pointArray'' <- (unpackStorableArrayWithLength pointCount') pointArray' freeMem pointArray' touchManagedPtr face freeMem pointCount freeMem pointArray return (result, pointArray'') -- function ot_layout_feature_with_variations_get_lookups -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the feature to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "variations_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the feature variation to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first lookup to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "lookup_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of lookups to return;\n Output = the actual number of lookups returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "lookup_indexes" -- , argType = TCArray False (-1) 5 (TBasicType TUInt) -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The array of lookups found for the query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "lookup_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of lookups to return;\n Output = the actual number of lookups returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_feature_with_variations_get_lookups" hb_ot_layout_feature_with_variations_get_lookups :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- feature_index : TBasicType TUInt Word32 -> -- variations_index : TBasicType TUInt Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- lookup_count : TBasicType TUInt Ptr (Ptr Word32) -> -- lookup_indexes : TCArray False (-1) 5 (TBasicType TUInt) IO Word32 -- | Fetches a list of all lookups enumerated for the specified feature, in -- the specified face\'s GSUB table or GPOS table, enabled at the specified -- variations index. The list returned will begin at the offset provided. -- -- /Since: 1.4.0/ otLayoutFeatureWithVariationsGetLookups :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@featureIndex@/: The index of the feature to query -> Word32 -- ^ /@variationsIndex@/: The index of the feature variation to query -> Word32 -- ^ /@startOffset@/: offset of the first lookup to retrieve -> m ((Word32, [Word32])) -- ^ __Returns:__ Total number of lookups. otLayoutFeatureWithVariationsGetLookups :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> Word32 -> m (Word32, [Word32]) otLayoutFeatureWithVariationsGetLookups FaceT face Word32 tableTag Word32 featureIndex Word32 variationsIndex Word32 startOffset = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face lookupCount <- allocMem :: IO (Ptr Word32) lookupIndexes <- callocMem :: IO (Ptr (Ptr Word32)) result <- hb_ot_layout_feature_with_variations_get_lookups face' tableTag featureIndex variationsIndex startOffset lookupCount lookupIndexes lookupCount' <- peek lookupCount lookupIndexes' <- peek lookupIndexes lookupIndexes'' <- (unpackStorableArrayWithLength lookupCount') lookupIndexes' freeMem lookupIndexes' touchManagedPtr face freeMem lookupCount freeMem lookupIndexes return (result, lookupIndexes'') -- function ot_layout_feature_get_name_ids -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "table tag to query, \"GSUB\" or \"GPOS\"." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "index of feature to query." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "label_id" -- , argType = TBasicType TUInt -- , argCType = Just "hb_ot_name_id_t*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The \8216name\8217 table name ID that specifies a string\n for a user-interface label for this feature." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "tooltip_id" -- , argType = TBasicType TUInt -- , argCType = Just "hb_ot_name_id_t*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The \8216name\8217 table name ID that specifies a string\n that an application can use for tooltip text for this\n feature." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "sample_id" -- , argType = TBasicType TUInt -- , argCType = Just "hb_ot_name_id_t*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The \8216name\8217 table name ID that specifies sample text\n that illustrates the effect of this feature." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "num_named_parameters" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Number of named parameters." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "first_param_id" -- , argType = TBasicType TUInt -- , argCType = Just "hb_ot_name_id_t*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The first \8216name\8217 table name ID used to specify\n strings for user-interface labels for the feature\n parameters. (Must be zero if numParameters is zero.)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_feature_get_name_ids" hb_ot_layout_feature_get_name_ids :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- feature_index : TBasicType TUInt Ptr Word32 -> -- label_id : TBasicType TUInt Ptr Word32 -> -- tooltip_id : TBasicType TUInt Ptr Word32 -> -- sample_id : TBasicType TUInt Ptr Word32 -> -- num_named_parameters : TBasicType TUInt Ptr Word32 -> -- first_param_id : TBasicType TUInt IO Int32 -- | Fetches name indices from feature parameters for \"Stylistic Set\" (\'ssXX\') or -- \"Character Variant\" (\'cvXX\') features. -- -- /Since: 2.0.0/ otLayoutFeatureGetNameIds :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: table tag to query, \"GSUB\" or \"GPOS\". -> Word32 -- ^ /@featureIndex@/: index of feature to query. -> m ((Int32, Word32, Word32, Word32, Word32, Word32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise otLayoutFeatureGetNameIds :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> m (Int32, Word32, Word32, Word32, Word32, Word32) otLayoutFeatureGetNameIds FaceT face Word32 tableTag Word32 featureIndex = IO (Int32, Word32, Word32, Word32, Word32, Word32) -> m (Int32, Word32, Word32, Word32, Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32, Word32, Word32, Word32, Word32) -> m (Int32, Word32, Word32, Word32, Word32, Word32)) -> IO (Int32, Word32, Word32, Word32, Word32, Word32) -> m (Int32, Word32, Word32, Word32, Word32, Word32) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face labelId <- allocMem :: IO (Ptr Word32) tooltipId <- allocMem :: IO (Ptr Word32) sampleId <- allocMem :: IO (Ptr Word32) numNamedParameters <- allocMem :: IO (Ptr Word32) firstParamId <- allocMem :: IO (Ptr Word32) result <- hb_ot_layout_feature_get_name_ids face' tableTag featureIndex labelId tooltipId sampleId numNamedParameters firstParamId labelId' <- peek labelId tooltipId' <- peek tooltipId sampleId' <- peek sampleId numNamedParameters' <- peek numNamedParameters firstParamId' <- peek firstParamId touchManagedPtr face freeMem labelId freeMem tooltipId freeMem sampleId freeMem numNamedParameters freeMem firstParamId return (result, labelId', tooltipId', sampleId', numNamedParameters', firstParamId') -- function ot_layout_feature_get_lookups -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the requested feature" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first lookup to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "lookup_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of lookups to return;\n Output = the actual number of lookups returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "lookup_indexes" -- , argType = TCArray False (-1) 4 (TBasicType TUInt) -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The array of lookup indexes found for the query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "lookup_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of lookups to return;\n Output = the actual number of lookups returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_feature_get_lookups" hb_ot_layout_feature_get_lookups :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- feature_index : TBasicType TUInt Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- lookup_count : TBasicType TUInt Ptr (Ptr Word32) -> -- lookup_indexes : TCArray False (-1) 4 (TBasicType TUInt) IO Word32 -- | Fetches a list of all lookups enumerated for the specified feature, in -- the specified face\'s GSUB table or GPOS table. The list returned will -- begin at the offset provided. -- -- /Since: 0.9.7/ otLayoutFeatureGetLookups :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@ -> Word32 -- ^ /@featureIndex@/: The index of the requested feature -> Word32 -- ^ /@startOffset@/: offset of the first lookup to retrieve -> m ((Word32, [Word32])) -- ^ __Returns:__ Total number of lookups. otLayoutFeatureGetLookups :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> m (Word32, [Word32]) otLayoutFeatureGetLookups FaceT face Word32 tableTag Word32 featureIndex Word32 startOffset = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face lookupCount <- allocMem :: IO (Ptr Word32) lookupIndexes <- callocMem :: IO (Ptr (Ptr Word32)) result <- hb_ot_layout_feature_get_lookups face' tableTag featureIndex startOffset lookupCount lookupIndexes lookupCount' <- peek lookupCount lookupIndexes' <- peek lookupIndexes lookupIndexes'' <- (unpackStorableArrayWithLength lookupCount') lookupIndexes' freeMem lookupIndexes' touchManagedPtr face freeMem lookupCount freeMem lookupIndexes return (result, lookupIndexes'') -- function ot_layout_feature_get_characters -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "table tag to query, \"GSUB\" or \"GPOS\"." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "index of feature to query." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first character to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "char_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of characters to return;\n Output = the actual number of characters returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "characters" -- , argType = TCArray False (-1) 4 (TBasicType TUInt32) -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "A buffer pointer.\n The Unicode codepoints of the characters for which this feature provides\n glyph variants." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "char_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of characters to return;\n Output = the actual number of characters returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_layout_feature_get_characters" hb_ot_layout_feature_get_characters :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- table_tag : TBasicType TUInt32 Word32 -> -- feature_index : TBasicType TUInt Word32 -> -- start_offset : TBasicType TUInt Word32 -> -- char_count : TBasicType TUInt Ptr Word32 -> -- characters : TCArray False (-1) 4 (TBasicType TUInt32) IO Word32 -- | Fetches a list of the characters defined as having a variant under the specified -- \"Character Variant\" (\"cvXX\") feature tag. -- -- /Since: 2.0.0/ otLayoutFeatureGetCharacters :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@tableTag@/: table tag to query, \"GSUB\" or \"GPOS\". -> Word32 -- ^ /@featureIndex@/: index of feature to query. -> Word32 -- ^ /@startOffset@/: offset of the first character to retrieve -> [Word32] -- ^ /@characters@/: A buffer pointer. -- The Unicode codepoints of the characters for which this feature provides -- glyph variants. -> m ((Word32, [Word32])) -- ^ __Returns:__ Number of total sample characters in the cvXX feature. otLayoutFeatureGetCharacters :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Word32 -> [Word32] -> m (Word32, [Word32]) otLayoutFeatureGetCharacters FaceT face Word32 tableTag Word32 featureIndex Word32 startOffset [Word32] characters = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do let charCount :: Word32 charCount = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Word32] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Word32] characters face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face characters' <- packStorableArray characters result <- hb_ot_layout_feature_get_characters face' tableTag featureIndex startOffset charCount characters' characters'' <- (unpackStorableArrayWithLength charCount) characters' freeMem characters' touchManagedPtr face return (result, characters'') -- function ot_layout_collect_lookups -- XXX Could not generate function ot_layout_collect_lookups -- Not implemented: Don't know how to allocate "lookup_indexes" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) -- function ot_layout_collect_features_map -- XXX Could not generate function ot_layout_collect_features_map -- Not implemented: Don't know how to allocate "feature_map" of type TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) -- function ot_layout_collect_features -- XXX Could not generate function ot_layout_collect_features -- Not implemented: Don't know how to allocate "feature_indexes" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) -- function ot_font_set_funcs -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_ot_font_set_funcs" hb_ot_font_set_funcs :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO () -- | Sets the font functions to use when working with /@font@/ to -- the HarfBuzz\'s native implementation. This is the default -- for fonts newly created. -- -- /Since: 0.9.28/ otFontSetFuncs :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m () otFontSetFuncs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m () otFontSetFuncs FontT font = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font hb_ot_font_set_funcs font' touchManagedPtr font return () -- function ot_color_palette_get_name_id -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "palette_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the color palette" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_palette_get_name_id" hb_ot_color_palette_get_name_id :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- palette_index : TBasicType TUInt IO Word32 -- | Fetches the @name@ table Name ID that provides display names for -- a @CPAL@ color palette. -- -- Palette display names can be generic (e.g., \"Default\") or provide -- specific, themed names (e.g., \"Spring\", \"Summer\", \"Fall\", and \"Winter\"). -- -- /Since: 2.1.0/ otColorPaletteGetNameId :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@paletteIndex@/: The index of the color palette -> m Word32 -- ^ __Returns:__ the Named ID found for the palette. -- If the requested palette has no name the result is @/HB_OT_NAME_ID_INVALID/@. otColorPaletteGetNameId :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m Word32 otColorPaletteGetNameId FaceT face Word32 paletteIndex = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_color_palette_get_name_id face' paletteIndex touchManagedPtr face return result -- function ot_color_palette_get_flags -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "palette_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the color palette" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name -- { namespace = "HarfBuzz" , name = "ot_color_palette_flags_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_palette_get_flags" hb_ot_color_palette_get_flags :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- palette_index : TBasicType TUInt IO CUInt -- | Fetches the flags defined for a color palette. -- -- /Since: 2.1.0/ otColorPaletteGetFlags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@paletteIndex@/: The index of the color palette -> m [HarfBuzz.Flags.OtColorPaletteFlagsT] -- ^ __Returns:__ the t'GI.HarfBuzz.Flags.OtColorPaletteFlagsT' of the requested color palette otColorPaletteGetFlags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m [OtColorPaletteFlagsT] otColorPaletteGetFlags FaceT face Word32 paletteIndex = IO [OtColorPaletteFlagsT] -> m [OtColorPaletteFlagsT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [OtColorPaletteFlagsT] -> m [OtColorPaletteFlagsT]) -> IO [OtColorPaletteFlagsT] -> m [OtColorPaletteFlagsT] forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_color_palette_get_flags face' paletteIndex let result' = CUInt -> [OtColorPaletteFlagsT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result touchManagedPtr face return result' -- function ot_color_palette_get_count -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_palette_get_count" hb_ot_color_palette_get_count :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Word32 -- | Fetches the number of color palettes in a face. -- -- /Since: 2.1.0/ otColorPaletteGetCount :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m Word32 -- ^ __Returns:__ the number of palettes found otColorPaletteGetCount :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Word32 otColorPaletteGetCount FaceT face = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_color_palette_get_count face' touchManagedPtr face return result -- function ot_color_palette_get_colors -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "palette_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the index of the color palette to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first color to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "color_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of colors to return;\n Output = the actual number of colors returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "colors" -- , argType = TCArray False (-1) 3 (TBasicType TUInt32) -- , argCType = Just "hb_color_t*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The array of #hb_color_t records found" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "color_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of colors to return;\n Output = the actual number of colors returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_palette_get_colors" hb_ot_color_palette_get_colors :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- palette_index : TBasicType TUInt Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- color_count : TBasicType TUInt Ptr (Ptr Word32) -> -- colors : TCArray False (-1) 3 (TBasicType TUInt32) IO Word32 -- | Fetches a list of the colors in a color palette. -- -- After calling this function, /@colors@/ will be filled with the palette -- colors. If /@colors@/ is NULL, the function will just return the number -- of total colors without storing any actual colors; this can be used -- for allocating a buffer of suitable size before calling -- 'GI.HarfBuzz.Functions.otColorPaletteGetColors' a second time. -- -- The RGBA values in the palette are unpremultiplied. See the -- OpenType spec <https://learn.microsoft.com/en-us/typography/opentype/spec/cpal CPAL> -- section for details. -- -- /Since: 2.1.0/ otColorPaletteGetColors :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@paletteIndex@/: the index of the color palette to query -> Word32 -- ^ /@startOffset@/: offset of the first color to retrieve -> m ((Word32, Maybe [Word32])) -- ^ __Returns:__ the total number of colors in the palette otColorPaletteGetColors :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> m (Word32, Maybe [Word32]) otColorPaletteGetColors FaceT face Word32 paletteIndex Word32 startOffset = IO (Word32, Maybe [Word32]) -> m (Word32, Maybe [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, Maybe [Word32]) -> m (Word32, Maybe [Word32])) -> IO (Word32, Maybe [Word32]) -> m (Word32, Maybe [Word32]) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face colorCount <- allocMem :: IO (Ptr Word32) colors <- callocMem :: IO (Ptr (Ptr Word32)) result <- hb_ot_color_palette_get_colors face' paletteIndex startOffset colorCount colors colorCount' <- peek colorCount colors' <- peek colors maybeColors' <- convertIfNonNull colors' $ \Ptr Word32 colors'' -> do colors''' <- (Word32 -> Ptr Word32 -> IO [Word32] forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b] unpackStorableArrayWithLength Word32 colorCount') Ptr Word32 colors'' freeMem colors'' return colors''' touchManagedPtr face freeMem colorCount freeMem colors return (result, maybeColors') -- function ot_color_palette_color_get_name_id -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "color_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the color" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_palette_color_get_name_id" hb_ot_color_palette_color_get_name_id :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- color_index : TBasicType TUInt IO Word32 -- | Fetches the @name@ table Name ID that provides display names for -- the specified color in a face\'s @CPAL@ color palette. -- -- Display names can be generic (e.g., \"Background\") or specific -- (e.g., \"Eye color\"). -- -- /Since: 2.1.0/ otColorPaletteColorGetNameId :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@colorIndex@/: The index of the color -> m Word32 -- ^ __Returns:__ the Name ID found for the color. otColorPaletteColorGetNameId :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m Word32 otColorPaletteColorGetNameId FaceT face Word32 colorIndex = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_color_palette_color_get_name_id face' colorIndex touchManagedPtr face return result -- function ot_color_has_svg -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_has_svg" hb_ot_color_has_svg :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether a face includes any @SVG@ glyph images. -- -- /Since: 2.1.0/ otColorHasSvg :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon. -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise. otColorHasSvg :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 otColorHasSvg FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_color_has_svg face' touchManagedPtr face return result -- function ot_color_has_png -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_has_png" hb_ot_color_has_png :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether a face has PNG glyph images (either in @CBDT@ or @sbix@ tables). -- -- /Since: 2.1.0/ otColorHasPng :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise otColorHasPng :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 otColorHasPng FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_color_has_png face' touchManagedPtr face return result -- function ot_color_has_palettes -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_has_palettes" hb_ot_color_has_palettes :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether a face includes a @CPAL@ color-palette table. -- -- /Since: 2.1.0/ otColorHasPalettes :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise otColorHasPalettes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 otColorHasPalettes FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_color_has_palettes face' touchManagedPtr face return result -- function ot_color_has_paint -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_has_paint" hb_ot_color_has_paint :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests where a face includes a @COLR@ table -- with data according to COLRv1. -- -- /Since: 7.0.0/ otColorHasPaint :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise otColorHasPaint :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 otColorHasPaint FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_color_has_paint face' touchManagedPtr face return result -- function ot_color_has_layers -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_has_layers" hb_ot_color_has_layers :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether a face includes a @COLR@ table -- with data according to COLRv0. -- -- /Since: 2.1.0/ otColorHasLayers :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise otColorHasLayers :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 otColorHasLayers FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_color_has_layers face' touchManagedPtr face return result -- function ot_color_glyph_reference_svg -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a svg glyph index" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_glyph_reference_svg" hb_ot_color_glyph_reference_svg :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- glyph : TBasicType TUInt32 IO (Ptr HarfBuzz.BlobT.BlobT) -- | Fetches the SVG document for a glyph. The blob may be either plain text or gzip-encoded. -- -- If the glyph has no SVG document, the singleton empty blob is returned. -- -- /Since: 2.1.0/ otColorGlyphReferenceSvg :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@glyph@/: a svg glyph index -> m HarfBuzz.BlobT.BlobT -- ^ __Returns:__ An t'GI.HarfBuzz.Structs.BlobT.BlobT' containing the SVG document of the glyph, if available otColorGlyphReferenceSvg :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m BlobT otColorGlyphReferenceSvg FaceT face Word32 glyph = IO BlobT -> m BlobT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_color_glyph_reference_svg face' glyph checkUnexpectedReturnNULL "otColorGlyphReferenceSvg" result result' <- (wrapBoxed HarfBuzz.BlobT.BlobT) result touchManagedPtr face return result' -- function ot_color_glyph_reference_png -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a glyph index" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_glyph_reference_png" hb_ot_color_glyph_reference_png :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 IO (Ptr HarfBuzz.BlobT.BlobT) -- | Fetches the PNG image for a glyph. This function takes a font object, not a face object, -- as input. To get an optimally sized PNG blob, the PPEM values must be set on the /@font@/ -- object. If PPEM is unset, the blob returned will be the largest PNG available. -- -- If the glyph has no PNG image, the singleton empty blob is returned. -- -- /Since: 2.1.0/ otColorGlyphReferencePng :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: a glyph index -> m HarfBuzz.BlobT.BlobT -- ^ __Returns:__ An t'GI.HarfBuzz.Structs.BlobT.BlobT' containing the PNG image for the glyph, if available otColorGlyphReferencePng :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m BlobT otColorGlyphReferencePng FontT font Word32 glyph = IO BlobT -> m BlobT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_ot_color_glyph_reference_png font' glyph checkUnexpectedReturnNULL "otColorGlyphReferencePng" result result' <- (wrapBoxed HarfBuzz.BlobT.BlobT) result touchManagedPtr font return result' -- function ot_color_glyph_has_paint -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph index to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_glyph_has_paint" hb_ot_color_glyph_has_paint :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Tests where a face includes COLRv1 paint -- data for /@glyph@/. -- -- /Since: 7.0.0/ otColorGlyphHasPaint :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@glyph@/: The glyph index to query -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise otColorGlyphHasPaint :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m Int32 otColorGlyphHasPaint FaceT face Word32 glyph = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_ot_color_glyph_has_paint face' glyph touchManagedPtr face return result -- function ot_color_glyph_get_layers -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph index to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first layer to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "layer_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of layers to return;\n Output = the actual number of layers returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "layers" -- , argType = -- TCArray -- False -- (-1) -- 3 -- (TInterface -- Name { namespace = "HarfBuzz" , name = "ot_color_layer_t" }) -- , argCType = Just "hb_ot_color_layer_t*" -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The array of layers found" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "layer_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of layers to return;\n Output = the actual number of layers returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_ot_color_glyph_get_layers" hb_ot_color_glyph_get_layers :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- glyph : TBasicType TUInt32 Word32 -> -- start_offset : TBasicType TUInt Word32 -> -- layer_count : TBasicType TUInt Ptr HarfBuzz.OtColorLayerT.OtColorLayerT -> -- layers : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "ot_color_layer_t"})) IO Word32 -- | Fetches a list of all color layers for the specified glyph index in the specified -- face. The list returned will begin at the offset provided. -- -- /Since: 2.1.0/ otColorGlyphGetLayers :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@glyph@/: The glyph index to query -> Word32 -- ^ /@startOffset@/: offset of the first layer to retrieve -> Maybe ([HarfBuzz.OtColorLayerT.OtColorLayerT]) -- ^ /@layers@/: The array of layers found -> m ((Word32, Maybe [HarfBuzz.OtColorLayerT.OtColorLayerT])) -- ^ __Returns:__ Total number of layers available for the glyph index queried otColorGlyphGetLayers :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> Word32 -> Maybe [OtColorLayerT] -> m (Word32, Maybe [OtColorLayerT]) otColorGlyphGetLayers FaceT face Word32 glyph Word32 startOffset Maybe [OtColorLayerT] layers = IO (Word32, Maybe [OtColorLayerT]) -> m (Word32, Maybe [OtColorLayerT]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, Maybe [OtColorLayerT]) -> m (Word32, Maybe [OtColorLayerT])) -> IO (Word32, Maybe [OtColorLayerT]) -> m (Word32, Maybe [OtColorLayerT]) forall a b. (a -> b) -> a -> b $ do let layerCount :: Word32 layerCount = case Maybe [OtColorLayerT] layers of Maybe [OtColorLayerT] Nothing -> Word32 0 Just [OtColorLayerT] jLayers -> Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [OtColorLayerT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [OtColorLayerT] jLayers face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face maybeLayers <- case layers of Maybe [OtColorLayerT] Nothing -> Ptr OtColorLayerT -> IO (Ptr OtColorLayerT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr OtColorLayerT forall a. Ptr a FP.nullPtr Just [OtColorLayerT] jLayers -> do jLayers' <- (OtColorLayerT -> IO (Ptr OtColorLayerT)) -> [OtColorLayerT] -> IO [Ptr OtColorLayerT] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b] mapM OtColorLayerT -> IO (Ptr OtColorLayerT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr [OtColorLayerT] jLayers jLayers'' <- packBlockArray 8 jLayers' return jLayers'' result <- hb_ot_color_glyph_get_layers face' glyph startOffset layerCount maybeLayers maybeMaybeLayers <- convertIfNonNull maybeLayers $ \Ptr OtColorLayerT maybeLayers' -> do maybeLayers'' <- (Int -> Word32 -> Ptr OtColorLayerT -> IO [Ptr OtColorLayerT] forall a b. Integral a => Int -> a -> Ptr b -> IO [Ptr b] unpackBlockArrayWithLength Int 8 Word32 layerCount) Ptr OtColorLayerT maybeLayers' maybeLayers''' <- mapM (wrapPtr HarfBuzz.OtColorLayerT.OtColorLayerT) maybeLayers'' freeMem maybeLayers' return maybeLayers''' touchManagedPtr face whenJust layers (mapM_ touchManagedPtr) return (result, maybeMaybeLayers) -- function map_values -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "values" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_map_values" hb_map_values :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) Ptr HarfBuzz.SetT.SetT -> -- values : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO () -- | Add the values of /@map@/ to /@values@/. -- -- /Since: 7.0.0/ mapValues :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> HarfBuzz.SetT.SetT -- ^ /@values@/: A set -> m () mapValues :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> SetT -> m () mapValues MapT map_ SetT values = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ values' <- unsafeManagedPtrGetPtr values hb_map_values map_' values' touchManagedPtr map_ touchManagedPtr values return () -- function map_update -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "other" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Another map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_map_update" hb_map_update :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) Ptr HarfBuzz.MapT.MapT -> -- other : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) IO () -- | Add the contents of /@other@/ to /@map@/. -- -- /Since: 7.0.0/ mapUpdate :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> HarfBuzz.MapT.MapT -- ^ /@other@/: Another map -> m () mapUpdate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> MapT -> m () mapUpdate MapT map_ MapT other = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ other' <- unsafeManagedPtrGetPtr other hb_map_update map_' other' touchManagedPtr map_ touchManagedPtr other return () -- function map_set -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "key" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The key to store in the map" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "value" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The value to store for @key" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_map_set" hb_map_set :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) Word32 -> -- key : TBasicType TUInt32 Word32 -> -- value : TBasicType TUInt32 IO () -- | Stores /@key@/:/@value@/ in the map. -- -- /Since: 1.7.7/ mapSet :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> Word32 -- ^ /@key@/: The key to store in the map -> Word32 -- ^ /@value@/: The value to store for /@key@/ -> m () mapSet :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> Word32 -> Word32 -> m () mapSet MapT map_ Word32 key Word32 value = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ hb_map_set map_' key value touchManagedPtr map_ return () -- function map_next -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "idx" -- , argType = TBasicType TInt -- , argCType = Just "int*" -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Iterator internal state" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "key" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Key retrieved" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "value" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Value retrieved" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_map_next" hb_map_next :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) Ptr Int32 -> -- idx : TBasicType TInt Ptr Word32 -> -- key : TBasicType TUInt32 Ptr Word32 -> -- value : TBasicType TUInt32 IO Int32 -- | Fetches the next key\/value pair in /@map@/. -- -- Set /@idx@/ to -1 to get started. -- -- If the map is modified during iteration, the behavior is undefined. -- -- The order in which the key\/values are returned is undefined. -- -- /Since: 7.0.0/ mapNext :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> Int32 -- ^ /@idx@/: Iterator internal state -> m ((Int32, Int32, Word32, Word32)) -- ^ __Returns:__ @true@ if there was a next value, @false@ otherwise mapNext :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> Int32 -> m (Int32, Int32, Word32, Word32) mapNext MapT map_ Int32 idx = IO (Int32, Int32, Word32, Word32) -> m (Int32, Int32, Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32, Word32, Word32) -> m (Int32, Int32, Word32, Word32)) -> IO (Int32, Int32, Word32, Word32) -> m (Int32, Int32, Word32, Word32) forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ idx' <- allocMem :: IO (Ptr Int32) poke idx' idx key <- allocMem :: IO (Ptr Word32) value <- allocMem :: IO (Ptr Word32) result <- hb_map_next map_' idx' key value idx'' <- peek idx' key' <- peek key value' <- peek value touchManagedPtr map_ freeMem idx' freeMem key freeMem value return (result, idx'', key', value') -- function map_keys -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "keys" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "set_t" } -- , argCType = Just "hb_set_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A set" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_map_keys" hb_map_keys :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) Ptr HarfBuzz.SetT.SetT -> -- keys : TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) IO () -- | Add the keys of /@map@/ to /@keys@/. -- -- /Since: 7.0.0/ mapKeys :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> HarfBuzz.SetT.SetT -- ^ /@keys@/: A set -> m () mapKeys :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> SetT -> m () mapKeys MapT map_ SetT keys = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ keys' <- unsafeManagedPtrGetPtr keys hb_map_keys map_' keys' touchManagedPtr map_ touchManagedPtr keys return () -- function map_is_equal -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "other" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Another map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_map_is_equal" hb_map_is_equal :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) Ptr HarfBuzz.MapT.MapT -> -- other : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) IO Int32 -- | Tests whether /@map@/ and /@other@/ are equal (contain the same -- elements). -- -- /Since: 4.3.0/ mapIsEqual :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> HarfBuzz.MapT.MapT -- ^ /@other@/: Another map -> m Int32 -- ^ __Returns:__ @true@ if the two maps are equal, @false@ otherwise. mapIsEqual :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> MapT -> m Int32 mapIsEqual MapT map_ MapT other = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ other' <- unsafeManagedPtrGetPtr other result <- hb_map_is_equal map_' other' touchManagedPtr map_ touchManagedPtr other return result -- function map_is_empty -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_map_is_empty" hb_map_is_empty :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) IO Int32 -- | Tests whether /@map@/ is empty (contains no elements). -- -- /Since: 1.7.7/ mapIsEmpty :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> m Int32 -- ^ __Returns:__ @true@ if /@map@/ is empty mapIsEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> m Int32 mapIsEmpty MapT map_ = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ result <- hb_map_is_empty map_' touchManagedPtr map_ return result -- function map_hash -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_map_hash" hb_map_hash :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) IO Word32 -- | Creates a hash representing /@map@/. -- -- /Since: 4.4.0/ mapHash :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> m Word32 -- ^ __Returns:__ A hash of /@map@/. mapHash :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> m Word32 mapHash MapT map_ = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ result <- hb_map_hash map_' touchManagedPtr map_ return result -- function map_has -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "key" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The key to query" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_map_has" hb_map_has :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) Word32 -> -- key : TBasicType TUInt32 IO Int32 -- | Tests whether /@key@/ is an element of /@map@/. -- -- /Since: 1.7.7/ mapHas :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> Word32 -- ^ /@key@/: The key to query -> m Int32 -- ^ __Returns:__ @true@ if /@key@/ is found in /@map@/, @false@ otherwise mapHas :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> Word32 -> m Int32 mapHas MapT map_ Word32 key = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ result <- hb_map_has map_' key touchManagedPtr map_ return result -- function map_get_population -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_map_get_population" hb_map_get_population :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) IO Word32 -- | Returns the number of key-value pairs in the map. -- -- /Since: 1.7.7/ mapGetPopulation :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> m Word32 -- ^ __Returns:__ The population of /@map@/ mapGetPopulation :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> m Word32 mapGetPopulation MapT map_ = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ result <- hb_map_get_population map_' touchManagedPtr map_ return result -- function map_get_empty -- Args: [] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "map_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_map_get_empty" hb_map_get_empty :: IO (Ptr HarfBuzz.MapT.MapT) -- | Fetches the singleton empty t'GI.HarfBuzz.Structs.MapT.MapT'. -- -- /Since: 1.7.7/ mapGetEmpty :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.MapT.MapT -- ^ __Returns:__ The empty t'GI.HarfBuzz.Structs.MapT.MapT' mapGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m MapT mapGetEmpty = IO MapT -> m MapT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO MapT -> m MapT) -> IO MapT -> m MapT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr MapT) hb_map_get_empty checkUnexpectedReturnNULL "mapGetEmpty" result result' <- (wrapBoxed HarfBuzz.MapT.MapT) result return result' -- function map_get -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "key" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The key to query" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "hb_map_get" hb_map_get :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) Word32 -> -- key : TBasicType TUInt32 IO Word32 -- | Fetches the value stored for /@key@/ in /@map@/. -- -- /Since: 1.7.7/ mapGet :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> Word32 -- ^ /@key@/: The key to query -> m Word32 mapGet :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> Word32 -> m Word32 mapGet MapT map_ Word32 key = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ result <- hb_map_get map_' key touchManagedPtr map_ return result -- function map_del -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "key" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The key to delete" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_map_del" hb_map_del :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) Word32 -> -- key : TBasicType TUInt32 IO () -- | Removes /@key@/ and its stored value from /@map@/. -- -- /Since: 1.7.7/ mapDel :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> Word32 -- ^ /@key@/: The key to delete -> m () mapDel :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> Word32 -> m () mapDel MapT map_ Word32 key = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ hb_map_del map_' key touchManagedPtr map_ return () -- function map_create -- Args: [] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "map_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_map_create" hb_map_create :: IO (Ptr HarfBuzz.MapT.MapT) -- | Creates a new, initially empty map. -- -- /Since: 1.7.7/ mapCreate :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.MapT.MapT -- ^ __Returns:__ The new t'GI.HarfBuzz.Structs.MapT.MapT' mapCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m MapT mapCreate = IO MapT -> m MapT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO MapT -> m MapT) -> IO MapT -> m MapT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr MapT) hb_map_create checkUnexpectedReturnNULL "mapCreate" result result' <- (wrapBoxed HarfBuzz.MapT.MapT) result return result' -- function map_copy -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "map_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_map_copy" hb_map_copy :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) IO (Ptr HarfBuzz.MapT.MapT) -- | Allocate a copy of /@map@/. -- -- /Since: 4.4.0/ mapCopy :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> m HarfBuzz.MapT.MapT -- ^ __Returns:__ Newly-allocated map. mapCopy :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> m MapT mapCopy MapT map_ = IO MapT -> m MapT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO MapT -> m MapT) -> IO MapT -> m MapT forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ result <- hb_map_copy map_' checkUnexpectedReturnNULL "mapCopy" result result' <- (wrapBoxed HarfBuzz.MapT.MapT) result touchManagedPtr map_ return result' -- function map_clear -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_map_clear" hb_map_clear :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) IO () -- | Clears out the contents of /@map@/. -- -- /Since: 1.7.7/ mapClear :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> m () mapClear :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> m () mapClear MapT map_ = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ hb_map_clear map_' touchManagedPtr map_ return () -- function map_allocation_successful -- Args: [ Arg -- { argCName = "map" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "map_t" } -- , argCType = Just "const hb_map_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A map" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_map_allocation_successful" hb_map_allocation_successful :: Ptr HarfBuzz.MapT.MapT -> -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) IO Int32 -- | Tests whether memory allocation for a set was successful. -- -- /Since: 1.7.7/ mapAllocationSuccessful :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.MapT.MapT -- ^ /@map@/: A map -> m Int32 -- ^ __Returns:__ @true@ if allocation succeeded, @false@ otherwise mapAllocationSuccessful :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> m Int32 mapAllocationSuccessful MapT map_ = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do map_' <- MapT -> IO (Ptr MapT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr MapT map_ result <- hb_map_allocation_successful map_' touchManagedPtr map_ return result -- function malloc -- Args: [ Arg -- { argCName = "size" -- , argType = TBasicType TSize -- , argCType = Just "size_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The size of the memory to allocate." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TPtr) -- throws : False -- Skip return : False foreign import ccall "hb_malloc" hb_malloc :: FCT.CSize -> -- size : TBasicType TSize IO (Ptr ()) -- | Allocates /@size@/ bytes of memory, using the allocator set at -- compile-time. Typically just @/malloc()/@. -- -- /Since: 11.0.0/ malloc :: (B.CallStack.HasCallStack, MonadIO m) => FCT.CSize -- ^ /@size@/: The size of the memory to allocate. -> m (Ptr ()) -- ^ __Returns:__ A pointer to the allocated memory. malloc :: forall (m :: * -> *). (HasCallStack, MonadIO m) => CSize -> m (Ptr ()) malloc CSize size = IO (Ptr ()) -> m (Ptr ()) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ()) forall a b. (a -> b) -> a -> b $ do result <- CSize -> IO (Ptr ()) hb_malloc CSize size return result -- function language_to_string -- Args: [ Arg -- { argCName = "language" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_language_t to convert" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "hb_language_to_string" hb_language_to_string :: Ptr HarfBuzz.LanguageT.LanguageT -> -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) IO CString -- | Converts an t'GI.HarfBuzz.Structs.LanguageT.LanguageT' to a string. -- -- /Since: 0.9.2/ languageToString :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.LanguageT.LanguageT -- ^ /@language@/: The t'GI.HarfBuzz.Structs.LanguageT.LanguageT' to convert -> m T.Text -- ^ __Returns:__ -- A @NULL@-terminated string representing the /@language@/. Must not be freed by -- the caller. languageToString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => LanguageT -> m Text languageToString LanguageT language = IO Text -> m Text forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Text -> m Text) -> IO Text -> m Text forall a b. (a -> b) -> a -> b $ do language' <- LanguageT -> IO (Ptr LanguageT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr LanguageT language result <- hb_language_to_string language' checkUnexpectedReturnNULL "languageToString" result result' <- cstringToText result touchManagedPtr language return result' -- function language_matches -- Args: [ Arg -- { argCName = "language" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_language_t to work on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "specific" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Another #hb_language_t" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_language_matches" hb_language_matches :: Ptr HarfBuzz.LanguageT.LanguageT -> -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) Ptr HarfBuzz.LanguageT.LanguageT -> -- specific : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) IO Int32 -- | Check whether a second language tag is the same or a more -- specific version of the provided language tag. For example, -- \"fa_IR.utf8\" is a more specific tag for \"fa\" or for \"fa_IR\". -- -- /Since: 5.0.0/ languageMatches :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.LanguageT.LanguageT -- ^ /@language@/: The t'GI.HarfBuzz.Structs.LanguageT.LanguageT' to work on -> HarfBuzz.LanguageT.LanguageT -- ^ /@specific@/: Another t'GI.HarfBuzz.Structs.LanguageT.LanguageT' -> m Int32 -- ^ __Returns:__ @true@ if languages match, @false@ otherwise. languageMatches :: forall (m :: * -> *). (HasCallStack, MonadIO m) => LanguageT -> LanguageT -> m Int32 languageMatches LanguageT language LanguageT specific = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do language' <- LanguageT -> IO (Ptr LanguageT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr LanguageT language specific' <- unsafeManagedPtrGetPtr specific result <- hb_language_matches language' specific' touchManagedPtr language touchManagedPtr specific return result -- function language_get_default -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "language_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_language_get_default" hb_language_get_default :: IO (Ptr HarfBuzz.LanguageT.LanguageT) -- | Fetch the default language from current locale. -- -- \<note>Note that the first time this function is called, it calls -- \"setlocale (LC_CTYPE, nullptr)\" to fetch current locale. The underlying -- setlocale function is, in many implementations, NOT threadsafe. To avoid -- problems, call this function once before multiple threads can call it. -- This function is only used from 'GI.HarfBuzz.Functions.bufferGuessSegmentProperties' by -- HarfBuzz itself.\<\/note> -- -- /Since: 0.9.2/ languageGetDefault :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.LanguageT.LanguageT -- ^ __Returns:__ The default language of the locale as -- an t'GI.HarfBuzz.Structs.LanguageT.LanguageT' languageGetDefault :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m LanguageT languageGetDefault = IO LanguageT -> m LanguageT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO LanguageT -> m LanguageT) -> IO LanguageT -> m LanguageT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr LanguageT) hb_language_get_default checkUnexpectedReturnNULL "languageGetDefault" result result' <- (newPtr HarfBuzz.LanguageT.LanguageT) result return result' -- function language_from_string -- Args: [ Arg -- { argCName = "str" -- , argType = TCArray False (-1) 1 (TBasicType TUInt8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "a string representing\n a BCP 47 language tag" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "length of the @str, or -1 if it is `NULL`-terminated." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "length of the @str, or -1 if it is `NULL`-terminated." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "language_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_language_from_string" hb_language_from_string :: Ptr Word8 -> -- str : TCArray False (-1) 1 (TBasicType TUInt8) Int32 -> -- len : TBasicType TInt IO (Ptr HarfBuzz.LanguageT.LanguageT) -- | Converts /@str@/ representing a BCP 47 language tag to the corresponding -- t'GI.HarfBuzz.Structs.LanguageT.LanguageT'. -- -- /Since: 0.9.2/ languageFromString :: (B.CallStack.HasCallStack, MonadIO m) => ByteString -- ^ /@str@/: a string representing -- a BCP 47 language tag -> m HarfBuzz.LanguageT.LanguageT -- ^ __Returns:__ -- The t'GI.HarfBuzz.Structs.LanguageT.LanguageT' corresponding to the BCP 47 language tag. languageFromString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ByteString -> m LanguageT languageFromString ByteString str = IO LanguageT -> m LanguageT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO LanguageT -> m LanguageT) -> IO LanguageT -> m LanguageT forall a b. (a -> b) -> a -> b $ do let len :: Int32 len = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString str str' <- ByteString -> IO (Ptr Word8) packByteString ByteString str result <- hb_language_from_string str' len checkUnexpectedReturnNULL "languageFromString" result result' <- (newPtr HarfBuzz.LanguageT.LanguageT) result freeMem str' return result' -- function glyph_info_get_glyph_flags -- Args: [ Arg -- { argCName = "info" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "glyph_info_t" } -- , argCType = Just "const hb_glyph_info_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #hb_glyph_info_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "glyph_flags_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_glyph_info_get_glyph_flags" hb_glyph_info_get_glyph_flags :: Ptr HarfBuzz.GlyphInfoT.GlyphInfoT -> -- info : TInterface (Name {namespace = "HarfBuzz", name = "glyph_info_t"}) IO CUInt -- | Returns glyph flags encoded within a t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'. -- -- /Since: 1.5.0/ glyphInfoGetGlyphFlags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.GlyphInfoT.GlyphInfoT -- ^ /@info@/: a t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT' -> m [HarfBuzz.Flags.GlyphFlagsT] -- ^ __Returns:__ The t'GI.HarfBuzz.Flags.GlyphFlagsT' encoded within /@info@/ glyphInfoGetGlyphFlags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GlyphInfoT -> m [GlyphFlagsT] glyphInfoGetGlyphFlags GlyphInfoT info = IO [GlyphFlagsT] -> m [GlyphFlagsT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [GlyphFlagsT] -> m [GlyphFlagsT]) -> IO [GlyphFlagsT] -> m [GlyphFlagsT] forall a b. (a -> b) -> a -> b $ do info' <- GlyphInfoT -> IO (Ptr GlyphInfoT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GlyphInfoT info result <- hb_glyph_info_get_glyph_flags info' let result' = CUInt -> [GlyphFlagsT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result touchManagedPtr info return result' -- function glib_script_to_script -- Args: [ Arg -- { argCName = "script" -- , argType = -- TInterface Name { namespace = "GLib" , name = "UnicodeScript" } -- , argCType = Just "GUnicodeScript" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The GUnicodeScript identifier to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "script_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_glib_script_to_script" hb_glib_script_to_script :: CInt -> -- script : TInterface (Name {namespace = "GLib", name = "UnicodeScript"}) IO CUInt -- | Fetches the t'GI.HarfBuzz.Flags.ScriptT' script that corresponds to the -- specified GUnicodeScript identifier. -- -- /Since: 0.9.38/ glibScriptToScript :: (B.CallStack.HasCallStack, MonadIO m) => GLib.Enums.UnicodeScript -- ^ /@script@/: The GUnicodeScript identifier to query -> m [HarfBuzz.Flags.ScriptT] -- ^ __Returns:__ the t'GI.HarfBuzz.Flags.ScriptT' script found glibScriptToScript :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnicodeScript -> m [ScriptT] glibScriptToScript UnicodeScript script = IO [ScriptT] -> m [ScriptT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [ScriptT] -> m [ScriptT]) -> IO [ScriptT] -> m [ScriptT] forall a b. (a -> b) -> a -> b $ do let script' :: CInt script' = (Int -> CInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CInt) -> (UnicodeScript -> Int) -> UnicodeScript -> CInt forall b c a. (b -> c) -> (a -> b) -> a -> c . UnicodeScript -> Int forall a. Enum a => a -> Int fromEnum) UnicodeScript script result <- CInt -> IO CUInt hb_glib_script_to_script CInt script' let result' = CUInt -> [ScriptT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result return result' -- function glib_script_from_script -- Args: [ Arg -- { argCName = "script" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "script_t" } -- , argCType = Just "hb_script_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_script_t to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "GLib" , name = "UnicodeScript" }) -- throws : False -- Skip return : False foreign import ccall "hb_glib_script_from_script" hb_glib_script_from_script :: CUInt -> -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"}) IO CInt -- | Fetches the GUnicodeScript identifier that corresponds to the -- specified t'GI.HarfBuzz.Flags.ScriptT' script. -- -- /Since: 0.9.38/ glibScriptFromScript :: (B.CallStack.HasCallStack, MonadIO m) => [HarfBuzz.Flags.ScriptT] -- ^ /@script@/: The t'GI.HarfBuzz.Flags.ScriptT' to query -> m GLib.Enums.UnicodeScript -- ^ __Returns:__ the GUnicodeScript identifier found glibScriptFromScript :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [ScriptT] -> m UnicodeScript glibScriptFromScript [ScriptT] script = IO UnicodeScript -> m UnicodeScript forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO UnicodeScript -> m UnicodeScript) -> IO UnicodeScript -> m UnicodeScript forall a b. (a -> b) -> a -> b $ do let script' :: CUInt script' = [ScriptT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ScriptT] script result <- CUInt -> IO CInt hb_glib_script_from_script CUInt script' let result' = (Int -> UnicodeScript forall a. Enum a => Int -> a toEnum (Int -> UnicodeScript) -> (CInt -> Int) -> CInt -> UnicodeScript forall b c a. (b -> c) -> (a -> b) -> a -> c . CInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CInt result return result' -- function glib_get_unicode_funcs -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_glib_get_unicode_funcs" hb_glib_get_unicode_funcs :: IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) -- | Fetches a Unicode-functions structure that is populated -- with the appropriate GLib function for each method. -- -- /Since: 0.9.38/ glibGetUnicodeFuncs :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ __Returns:__ a pointer to the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' Unicode-functions structure glibGetUnicodeFuncs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m UnicodeFuncsT glibGetUnicodeFuncs = IO UnicodeFuncsT -> m UnicodeFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT) -> IO UnicodeFuncsT -> m UnicodeFuncsT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr UnicodeFuncsT) hb_glib_get_unicode_funcs checkUnexpectedReturnNULL "glibGetUnicodeFuncs" result result' <- (newBoxed HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) result return result' -- function glib_blob_create -- Args: [ Arg -- { argCName = "gbytes" -- , argType = TInterface Name { namespace = "GLib" , name = "Bytes" } -- , argCType = Just "GBytes*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the GBytes structure to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_glib_blob_create" hb_glib_blob_create :: Ptr GLib.Bytes.Bytes -> -- gbytes : TInterface (Name {namespace = "GLib", name = "Bytes"}) IO (Ptr HarfBuzz.BlobT.BlobT) -- | Creates an t'GI.HarfBuzz.Structs.BlobT.BlobT' blob from the specified -- GBytes data structure. -- -- /Since: 0.9.38/ glibBlobCreate :: (B.CallStack.HasCallStack, MonadIO m) => GLib.Bytes.Bytes -- ^ /@gbytes@/: the GBytes structure to work upon -> m HarfBuzz.BlobT.BlobT -- ^ __Returns:__ the new t'GI.HarfBuzz.Structs.BlobT.BlobT' blob object glibBlobCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Bytes -> m BlobT glibBlobCreate Bytes gbytes = IO BlobT -> m BlobT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT forall a b. (a -> b) -> a -> b $ do gbytes' <- Bytes -> IO (Ptr Bytes) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Bytes gbytes result <- hb_glib_blob_create gbytes' checkUnexpectedReturnNULL "glibBlobCreate" result result' <- (wrapBoxed HarfBuzz.BlobT.BlobT) result touchManagedPtr gbytes return result' -- function ft_hb_font_changed -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ft_hb_font_changed" hb_ft_hb_font_changed :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO Int32 -- | Refreshes the state of the underlying FT_Face of /@font@/ when the hb_font_t -- /@font@/ has changed. -- This function should be called after changing the size or -- variation-axis settings on the /@font@/. -- This call is fast if nothing has changed on /@font@/. -- -- Note that as of version 11.0.0, calling this function is not necessary, -- as HarfBuzz will automatically detect changes to the font and update -- the underlying FT_Face as needed. -- -- /Since: 4.4.0/ ftHbFontChanged :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m Int32 -- ^ __Returns:__ true if changed, false otherwise ftHbFontChanged :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Int32 ftHbFontChanged FontT font = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_ft_hb_font_changed font' touchManagedPtr font return result -- function ft_font_set_load_flags -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "load_flags" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The FreeType load flags to set" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_ft_font_set_load_flags" hb_ft_font_set_load_flags :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Int32 -> -- load_flags : TBasicType TInt IO () -- | Sets the FT_Load_Glyph load flags for the specified t'GI.HarfBuzz.Structs.FontT.FontT'. -- -- For more information, see -- \<https:\/\/freetype.org\/freetype2\/docs\/reference\/ft2-glyph_retrieval.html@/ft_load_xxx/@> -- -- This function works with t'GI.HarfBuzz.Structs.FontT.FontT' objects created by -- @/hb_ft_font_create()/@ or 'GI.HarfBuzz.Functions.ftFontCreateReferenced'. -- -- /Since: 1.0.5/ ftFontSetLoadFlags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Int32 -- ^ /@loadFlags@/: The FreeType load flags to set -> m () ftFontSetLoadFlags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Int32 -> m () ftFontSetLoadFlags FontT font Int32 loadFlags = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font hb_ft_font_set_load_flags font' loadFlags touchManagedPtr font return () -- function ft_font_set_funcs -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_ft_font_set_funcs" hb_ft_font_set_funcs :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO () -- | Configures the font-functions structure of the specified -- t'GI.HarfBuzz.Structs.FontT.FontT' font object to use FreeType font functions. -- -- In particular, you can use this function to configure an -- existing t'GI.HarfBuzz.Structs.FaceT.FaceT' face object for use with FreeType font -- functions even if that t'GI.HarfBuzz.Structs.FaceT.FaceT' face object was initially -- created with 'GI.HarfBuzz.Functions.faceCreate', and therefore was not -- initially configured to use FreeType font functions. -- -- An t'GI.HarfBuzz.Structs.FontT.FontT' object created with @/hb_ft_font_create()/@ -- is preconfigured for FreeType font functions and does not -- require this function to be used. -- -- Note that if you modify the underlying t'GI.HarfBuzz.Structs.FontT.FontT' after -- calling this function, you need to call 'GI.HarfBuzz.Functions.ftHbFontChanged' -- to update the underlying FT_Face. -- -- \<note>Note: Internally, this function creates an FT_Face. -- \<\/note> -- -- /Since: 1.0.5/ ftFontSetFuncs :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m () ftFontSetFuncs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m () ftFontSetFuncs FontT font = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font hb_ft_font_set_funcs font' touchManagedPtr font return () -- function ft_font_get_load_flags -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_ft_font_get_load_flags" hb_ft_font_get_load_flags :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO Int32 -- | Fetches the FT_Load_Glyph load flags of the specified t'GI.HarfBuzz.Structs.FontT.FontT'. -- -- For more information, see -- \<https:\/\/freetype.org\/freetype2\/docs\/reference\/ft2-glyph_retrieval.html@/ft_load_xxx/@> -- -- This function works with t'GI.HarfBuzz.Structs.FontT.FontT' objects created by -- @/hb_ft_font_create()/@ or 'GI.HarfBuzz.Functions.ftFontCreateReferenced'. -- -- /Since: 1.0.5/ ftFontGetLoadFlags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m Int32 -- ^ __Returns:__ FT_Load_Glyph flags found, or 0 ftFontGetLoadFlags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Int32 ftFontGetLoadFlags FontT font = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_ft_font_get_load_flags font' touchManagedPtr font return result -- function ft_font_create_referenced -- Args: [ Arg -- { argCName = "ft_face" -- , argType = -- TInterface Name { namespace = "freetype2" , name = "Face" } -- , argCType = Just "FT_Face" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "FT_Face to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "font_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ft_font_create_referenced" hb_ft_font_create_referenced :: Ptr Freetype2.Face.Face -> -- ft_face : TInterface (Name {namespace = "freetype2", name = "Face"}) IO (Ptr HarfBuzz.FontT.FontT) -- | Creates an t'GI.HarfBuzz.Structs.FontT.FontT' font object from the specified FT_Face. -- -- \<note>Note: You must set the face size on /@ftFace@/ before calling -- 'GI.HarfBuzz.Functions.ftFontCreateReferenced' on it. HarfBuzz assumes size is always set -- and will access @size@ member of FT_Face unconditionally.\<\/note> -- -- This is the preferred variant of the hb_ft_font_create* -- function family, because it calls @/FT_Reference_Face()/@ on /@ftFace@/, -- ensuring that /@ftFace@/ remains alive as long as the resulting -- t'GI.HarfBuzz.Structs.FontT.FontT' font object remains alive. -- -- Use this version unless you know you have good reasons not to. -- -- /Since: 0.9.38/ ftFontCreateReferenced :: (B.CallStack.HasCallStack, MonadIO m) => Freetype2.Face.Face -- ^ /@ftFace@/: FT_Face to work upon -> m HarfBuzz.FontT.FontT -- ^ __Returns:__ the new t'GI.HarfBuzz.Structs.FontT.FontT' font object ftFontCreateReferenced :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Face -> m FontT ftFontCreateReferenced Face ftFace = IO FontT -> m FontT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FontT -> m FontT) -> IO FontT -> m FontT forall a b. (a -> b) -> a -> b $ do ftFace' <- Face -> IO (Ptr Face) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Face ftFace result <- hb_ft_font_create_referenced ftFace' checkUnexpectedReturnNULL "ftFontCreateReferenced" result result' <- (wrapBoxed HarfBuzz.FontT.FontT) result touchManagedPtr ftFace return result' -- function ft_font_changed -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_ft_font_changed" hb_ft_font_changed :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO () -- | Refreshes the state of /@font@/ when the underlying FT_Face has changed. -- This function should be called after changing the size or -- variation-axis settings on the FT_Face. -- -- /Since: 1.0.5/ ftFontChanged :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m () ftFontChanged :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m () ftFontChanged FontT font = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font hb_ft_font_changed font' touchManagedPtr font return () -- function ft_face_create_referenced -- Args: [ Arg -- { argCName = "ft_face" -- , argType = -- TInterface Name { namespace = "freetype2" , name = "Face" } -- , argCType = Just "FT_Face" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "FT_Face to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ft_face_create_referenced" hb_ft_face_create_referenced :: Ptr Freetype2.Face.Face -> -- ft_face : TInterface (Name {namespace = "freetype2", name = "Face"}) IO (Ptr HarfBuzz.FaceT.FaceT) -- | Creates an t'GI.HarfBuzz.Structs.FaceT.FaceT' face object from the specified FT_Face. -- -- Note that this is using the FT_Face object just to get at the underlying -- font data, and fonts created from the returned t'GI.HarfBuzz.Structs.FaceT.FaceT' will use the native -- HarfBuzz font implementation, unless you call 'GI.HarfBuzz.Functions.ftFontSetFuncs' on them. -- -- This is the preferred variant of the hb_ft_face_create* -- function family, because it calls @/FT_Reference_Face()/@ on /@ftFace@/, -- ensuring that /@ftFace@/ remains alive as long as the resulting -- t'GI.HarfBuzz.Structs.FaceT.FaceT' face object remains alive. Also calls @/FT_Done_Face()/@ -- when the t'GI.HarfBuzz.Structs.FaceT.FaceT' face object is destroyed. -- -- Use this version unless you know you have good reasons not to. -- -- /Since: 0.9.38/ ftFaceCreateReferenced :: (B.CallStack.HasCallStack, MonadIO m) => Freetype2.Face.Face -- ^ /@ftFace@/: FT_Face to work upon -> m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ the new t'GI.HarfBuzz.Structs.FaceT.FaceT' face object ftFaceCreateReferenced :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Face -> m FaceT ftFaceCreateReferenced Face ftFace = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do ftFace' <- Face -> IO (Ptr Face) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Face ftFace result <- hb_ft_face_create_referenced ftFace' checkUnexpectedReturnNULL "ftFaceCreateReferenced" result result' <- (wrapBoxed HarfBuzz.FaceT.FaceT) result touchManagedPtr ftFace return result' -- function ft_face_create_from_file_or_fail -- Args: [ Arg -- { argCName = "file_name" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A font filename" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the face within the file" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ft_face_create_from_file_or_fail" hb_ft_face_create_from_file_or_fail :: CString -> -- file_name : TBasicType TUTF8 Word32 -> -- index : TBasicType TUInt IO (Ptr HarfBuzz.FaceT.FaceT) -- | Creates an t'GI.HarfBuzz.Structs.FaceT.FaceT' face object from the specified -- font file and face index. -- -- This is similar in functionality to 'GI.HarfBuzz.Functions.faceCreateFromFileOrFail', -- but uses the FreeType library for loading the font file. This can -- be useful, for example, to load WOFF and WOFF2 font data. -- -- /Since: 10.1.0/ ftFaceCreateFromFileOrFail :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@fileName@/: A font filename -> Word32 -- ^ /@index@/: The index of the face within the file -> m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ The new face object, or @NULL@ if -- no face is found at the specified index or the file cannot be read. ftFaceCreateFromFileOrFail :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> Word32 -> m FaceT ftFaceCreateFromFileOrFail Text fileName Word32 index = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do fileName' <- Text -> IO (Ptr CChar) textToCString Text fileName result <- hb_ft_face_create_from_file_or_fail fileName' index checkUnexpectedReturnNULL "ftFaceCreateFromFileOrFail" result result' <- (wrapBoxed HarfBuzz.FaceT.FaceT) result freeMem fileName' return result' -- function ft_face_create_from_blob_or_fail -- Args: [ Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A blob" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the face within the blob" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ft_face_create_from_blob_or_fail" hb_ft_face_create_from_blob_or_fail :: Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) Word32 -> -- index : TBasicType TUInt IO (Ptr HarfBuzz.FaceT.FaceT) -- | Creates an t'GI.HarfBuzz.Structs.FaceT.FaceT' face object from the specified -- font blob and face index. -- -- This is similar in functionality to @/hb_face_create_from_blob_or_fail()/@, -- but uses the FreeType library for loading the font blob. This can -- be useful, for example, to load WOFF and WOFF2 font data. -- -- /Since: 11.0.0/ ftFaceCreateFromBlobOrFail :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@blob@/: A blob -> Word32 -- ^ /@index@/: The index of the face within the blob -> m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ The new face object, or @NULL@ if -- loading fails (eg. blob does not contain valid font data). ftFaceCreateFromBlobOrFail :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> Word32 -> m FaceT ftFaceCreateFromBlobOrFail BlobT blob Word32 index = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do blob' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT blob result <- hb_ft_face_create_from_blob_or_fail blob' index checkUnexpectedReturnNULL "ftFaceCreateFromBlobOrFail" result result' <- (wrapBoxed HarfBuzz.FaceT.FaceT) result touchManagedPtr blob return result' -- function ft_face_create_cached -- Args: [ Arg -- { argCName = "ft_face" -- , argType = -- TInterface Name { namespace = "freetype2" , name = "Face" } -- , argCType = Just "FT_Face" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "FT_Face to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_ft_face_create_cached" hb_ft_face_create_cached :: Ptr Freetype2.Face.Face -> -- ft_face : TInterface (Name {namespace = "freetype2", name = "Face"}) IO (Ptr HarfBuzz.FaceT.FaceT) -- | Creates an t'GI.HarfBuzz.Structs.FaceT.FaceT' face object from the specified FT_Face. -- -- Note that this is using the FT_Face object just to get at the underlying -- font data, and fonts created from the returned t'GI.HarfBuzz.Structs.FaceT.FaceT' will use the native -- HarfBuzz font implementation, unless you call 'GI.HarfBuzz.Functions.ftFontSetFuncs' on them. -- -- This variant of the function caches the newly created t'GI.HarfBuzz.Structs.FaceT.FaceT' -- face object, using the /@generic@/ pointer of /@ftFace@/. Subsequent function -- calls that are passed the same /@ftFace@/ parameter will have the same -- t'GI.HarfBuzz.Structs.FaceT.FaceT' returned to them, and that t'GI.HarfBuzz.Structs.FaceT.FaceT' will be correctly -- reference counted. -- -- However, client programs are still responsible for destroying -- /@ftFace@/ after the last t'GI.HarfBuzz.Structs.FaceT.FaceT' face object has been destroyed. -- -- /Since: 0.9.2/ ftFaceCreateCached :: (B.CallStack.HasCallStack, MonadIO m) => Freetype2.Face.Face -- ^ /@ftFace@/: FT_Face to work upon -> m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ the new t'GI.HarfBuzz.Structs.FaceT.FaceT' face object ftFaceCreateCached :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Face -> m FaceT ftFaceCreateCached Face ftFace = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do ftFace' <- Face -> IO (Ptr Face) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Face ftFace result <- hb_ft_face_create_cached ftFace' checkUnexpectedReturnNULL "ftFaceCreateCached" result result' <- (wrapBoxed HarfBuzz.FaceT.FaceT) result touchManagedPtr ftFace return result' -- function free -- Args: [ Arg -- { argCName = "ptr" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The pointer to the memory to free." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_free" hb_free :: Ptr () -> -- ptr : TBasicType TPtr IO () -- | Frees the memory pointed to by /@ptr@/, using the allocator set at -- compile-time. Typically just @/free()/@. -- -- /Since: 11.0.0/ free :: (B.CallStack.HasCallStack, MonadIO m) => Ptr () -- ^ /@ptr@/: The pointer to the memory to free. -> m () free :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Ptr () -> m () free Ptr () ptr = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do Ptr () -> IO () hb_free Ptr () ptr () -> IO () forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return () -- function font_subtract_glyph_origin_for_direction -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The direction of the text segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = The original X coordinate\n Output = The X coordinate minus the X-coordinate of the origin" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = The original Y coordinate\n Output = The Y coordinate minus the Y-coordinate of the origin" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_subtract_glyph_origin_for_direction" hb_font_subtract_glyph_origin_for_direction :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Ptr Int32 -> -- x : TBasicType TInt32 Ptr Int32 -> -- y : TBasicType TInt32 IO () -- | Subtracts the origin coordinates from an (X,Y) point coordinate, -- in the specified glyph ID in the specified font. -- -- Calls the appropriate direction-specific variant (horizontal -- or vertical) depending on the value of /@direction@/. -- -- /Since: 0.9.2/ fontSubtractGlyphOriginForDirection :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The direction of the text segment -> Int32 -- ^ /@x@/: Input = The original X coordinate -- Output = The X coordinate minus the X-coordinate of the origin -> Int32 -- ^ /@y@/: Input = The original Y coordinate -- Output = The Y coordinate minus the Y-coordinate of the origin -> m ((Int32, Int32)) fontSubtractGlyphOriginForDirection :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> DirectionT -> Int32 -> Int32 -> m (Int32, Int32) fontSubtractGlyphOriginForDirection FontT font Word32 glyph DirectionT direction Int32 x Int32 y = IO (Int32, Int32) -> m (Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32) -> m (Int32, Int32)) -> IO (Int32, Int32) -> m (Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction x' <- allocMem :: IO (Ptr Int32) poke x' x y' <- allocMem :: IO (Ptr Int32) poke y' y hb_font_subtract_glyph_origin_for_direction font' glyph direction' x' y' x'' <- peek x' y'' <- peek y' touchManagedPtr font freeMem x' freeMem y' return (x'', y'') -- function font_set_variations -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "variations" -- , argType = -- TCArray -- False -- (-1) -- 2 -- (TInterface Name { namespace = "HarfBuzz" , name = "variation_t" }) -- , argCType = Just "const hb_variation_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Array of variation settings to apply" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "variations_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Number of variations to apply" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "variations_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Number of variations to apply" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_variations" hb_font_set_variations :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr HarfBuzz.VariationT.VariationT -> -- variations : TCArray False (-1) 2 (TInterface (Name {namespace = "HarfBuzz", name = "variation_t"})) Word32 -> -- variations_length : TBasicType TUInt IO () -- | Applies a list of font-variation settings to a font. -- -- Note that this overrides all existing variations set on /@font@/. -- Axes not included in /@variations@/ will be effectively set to their -- default values. -- -- /Since: 1.4.2/ fontSetVariations :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> [HarfBuzz.VariationT.VariationT] -- ^ /@variations@/: Array of variation settings to apply -> m () fontSetVariations :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [VariationT] -> m () fontSetVariations FontT font [VariationT] variations = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let variationsLength :: Word32 variationsLength = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [VariationT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [VariationT] variations font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font variations' <- mapM unsafeManagedPtrGetPtr variations variations'' <- packBlockArray 8 variations' hb_font_set_variations font' variations'' variationsLength touchManagedPtr font mapM_ touchManagedPtr variations freeMem variations'' return () -- function font_set_variation -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_tag_t tag of the variation-axis name" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "value" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The value of the variation axis" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_variation" hb_font_set_variation :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- tag : TBasicType TUInt32 CFloat -> -- value : TBasicType TFloat IO () -- | Change the value of one variation axis on the font. -- -- Note: This function is expensive to be called repeatedly. -- If you want to set multiple variation axes at the same time, -- use 'GI.HarfBuzz.Functions.fontSetVariations' instead. -- -- /Since: 7.1.0/ fontSetVariation :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@tag@/: The @/hb_tag_t/@ tag of the variation-axis name -> Float -- ^ /@value@/: The value of the variation axis -> m () fontSetVariation :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Float -> m () fontSetVariation FontT font Word32 tag Float value = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let value' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float value hb_font_set_variation font' tag value' touchManagedPtr font return () -- function font_set_var_named_instance -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a font." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "instance_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "named instance index." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_var_named_instance" hb_font_set_var_named_instance :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- instance_index : TBasicType TUInt IO () -- | Sets design coords of a font from a named-instance index. -- -- /Since: 2.6.0/ fontSetVarNamedInstance :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: a font. -> Word32 -- ^ /@instanceIndex@/: named instance index. -> m () fontSetVarNamedInstance :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m () fontSetVarNamedInstance FontT font Word32 instanceIndex = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font hb_font_set_var_named_instance font' instanceIndex touchManagedPtr font return () -- function font_set_var_coords_normalized -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coords" -- , argType = TCArray False (-1) 2 (TBasicType TInt) -- , argCType = Just "const int*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Array of variation coordinates to apply" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coords_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Number of coordinates to apply" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "coords_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Number of coordinates to apply" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_var_coords_normalized" hb_font_set_var_coords_normalized :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr Int32 -> -- coords : TCArray False (-1) 2 (TBasicType TInt) Word32 -> -- coords_length : TBasicType TUInt IO () -- | Applies a list of variation coordinates (in normalized units) -- to a font. -- -- Note that this overrides all existing variations set on /@font@/. -- Axes not included in /@coords@/ will be effectively set to their -- default values. -- -- \<note>Note: Coordinates should be normalized to 2.14.\<\/note> -- -- /Since: 1.4.2/ fontSetVarCoordsNormalized :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> [Int32] -- ^ /@coords@/: Array of variation coordinates to apply -> m () fontSetVarCoordsNormalized :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [Int32] -> m () fontSetVarCoordsNormalized FontT font [Int32] coords = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let coordsLength :: Word32 coordsLength = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Int32] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Int32] coords font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font coords' <- packStorableArray coords hb_font_set_var_coords_normalized font' coords' coordsLength touchManagedPtr font freeMem coords' return () -- function font_set_var_coords_design -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coords" -- , argType = TCArray False (-1) 2 (TBasicType TFloat) -- , argCType = Just "const float*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Array of variation coordinates to apply" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "coords_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Number of coordinates to apply" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "coords_length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Number of coordinates to apply" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_var_coords_design" hb_font_set_var_coords_design :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr CFloat -> -- coords : TCArray False (-1) 2 (TBasicType TFloat) Word32 -> -- coords_length : TBasicType TUInt IO () -- | Applies a list of variation coordinates (in design-space units) -- to a font. -- -- Note that this overrides all existing variations set on /@font@/. -- Axes not included in /@coords@/ will be effectively set to their -- default values. -- -- /Since: 1.4.2/ fontSetVarCoordsDesign :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> [Float] -- ^ /@coords@/: Array of variation coordinates to apply -> m () fontSetVarCoordsDesign :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [Float] -> m () fontSetVarCoordsDesign FontT font [Float] coords = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let coordsLength :: Word32 coordsLength = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [Float] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Float] coords font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font coords' <- (packMapStorableArray realToFrac) coords hb_font_set_var_coords_design font' coords' coordsLength touchManagedPtr font freeMem coords' return () -- function font_set_synthetic_slant -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "slant" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "synthetic slant value." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_synthetic_slant" hb_font_set_synthetic_slant :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CFloat -> -- slant : TBasicType TFloat IO () -- | Sets the \"synthetic slant\" of a font. By default is zero. -- Synthetic slant is the graphical skew applied to the font -- at rendering time. -- -- HarfBuzz needs to know this value to adjust shaping results, -- metrics, and style values to match the slanted rendering. -- -- \<note>Note: The glyph shape fetched via the 'GI.HarfBuzz.Functions.fontDrawGlyphOrFail' -- function is slanted to reflect this value as well.\<\/note> -- -- \<note>Note: The slant value is a ratio. For example, a -- 20% slant would be represented as a 0.2 value.\<\/note> -- -- /Since: 3.3.0/ fontSetSyntheticSlant :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Float -- ^ /@slant@/: synthetic slant value. -> m () fontSetSyntheticSlant :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Float -> m () fontSetSyntheticSlant FontT font Float slant = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let slant' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float slant hb_font_set_synthetic_slant font' slant' touchManagedPtr font return () -- function font_set_synthetic_bold -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x_embolden" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the amount to embolden horizontally" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y_embolden" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the amount to embolden vertically" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "in_place" -- , argType = TBasicType TInt -- , argCType = Just "hb_bool_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "whether to embolden glyphs in-place" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_synthetic_bold" hb_font_set_synthetic_bold :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CFloat -> -- x_embolden : TBasicType TFloat CFloat -> -- y_embolden : TBasicType TFloat Int32 -> -- in_place : TBasicType TInt IO () -- | Sets the \"synthetic boldness\" of a font. -- -- Positive values for /@xEmbolden@/ \/ /@yEmbolden@/ make a font -- bolder, negative values thinner. Typical values are in the -- 0.01 to 0.05 range. The default value is zero. -- -- Synthetic boldness is applied by offsetting the contour -- points of the glyph shape. -- -- Synthetic boldness is applied when rendering a glyph via -- 'GI.HarfBuzz.Functions.fontDrawGlyphOrFail'. -- -- If /@inPlace@/ is @false@, then glyph advance-widths are also -- adjusted, otherwise they are not. The in-place mode is -- useful for simulating <https://fonts.google.com/knowledge/glossary/grade font grading>. -- -- /Since: 7.0.0/ fontSetSyntheticBold :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Float -- ^ /@xEmbolden@/: the amount to embolden horizontally -> Float -- ^ /@yEmbolden@/: the amount to embolden vertically -> Int32 -- ^ /@inPlace@/: whether to embolden glyphs in-place -> m () fontSetSyntheticBold :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Float -> Float -> Int32 -> m () fontSetSyntheticBold FontT font Float xEmbolden Float yEmbolden Int32 inPlace = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let xEmbolden' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float xEmbolden let yEmbolden' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float yEmbolden hb_font_set_synthetic_bold font' xEmbolden' yEmbolden' inPlace touchManagedPtr font return () -- function font_set_scale -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x_scale" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Horizontal scale value to assign" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y_scale" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Vertical scale value to assign" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_scale" hb_font_set_scale :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Int32 -> -- x_scale : TBasicType TInt Int32 -> -- y_scale : TBasicType TInt IO () -- | Sets the horizontal and vertical scale of a font. -- -- The font scale is a number related to, but not the same as, -- font size. Typically the client establishes a scale factor -- to be used between the two. For example, 64, or 256, which -- would be the fractional-precision part of the font scale. -- This is necessary because @/hb_position_t/@ values are integer -- types and you need to leave room for fractional values -- in there. -- -- For example, to set the font size to 20, with 64 -- levels of fractional precision you would call -- @hb_font_set_scale(font, 20 * 64, 20 * 64)@. -- -- In the example above, even what font size 20 means is up to -- you. It might be 20 pixels, or 20 points, or 20 millimeters. -- HarfBuzz does not care about that. You can set the point -- size of the font using 'GI.HarfBuzz.Functions.fontSetPtem', and the pixel -- size using 'GI.HarfBuzz.Functions.fontSetPpem'. -- -- The choice of scale is yours but needs to be consistent between -- what you set here, and what you expect out of @/hb_position_t/@ -- as well has draw \/ paint API output values. -- -- Fonts default to a scale equal to the UPEM value of their face. -- A font with this setting is sometimes called an \"unscaled\" font. -- -- /Since: 0.9.2/ fontSetScale :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Int32 -- ^ /@xScale@/: Horizontal scale value to assign -> Int32 -- ^ /@yScale@/: Vertical scale value to assign -> m () fontSetScale :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Int32 -> Int32 -> m () fontSetScale FontT font Int32 xScale Int32 yScale = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font hb_font_set_scale font' xScale yScale touchManagedPtr font return () -- function font_set_ptem -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "ptem" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "font size in points." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_ptem" hb_font_set_ptem :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CFloat -> -- ptem : TBasicType TFloat IO () -- | Sets the \"point size\" of a font. Set to zero to unset. -- Used in CoreText to implement optical sizing. -- -- \<note>Note: There are 72 points in an inch.\<\/note> -- -- /Since: 1.6.0/ fontSetPtem :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Float -- ^ /@ptem@/: font size in points. -> m () fontSetPtem :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Float -> m () fontSetPtem FontT font Float ptem = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let ptem' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float ptem hb_font_set_ptem font' ptem' touchManagedPtr font return () -- function font_set_ppem -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x_ppem" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Horizontal ppem value to assign" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "y_ppem" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Vertical ppem value to assign" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_ppem" hb_font_set_ppem :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- x_ppem : TBasicType TUInt Word32 -> -- y_ppem : TBasicType TUInt IO () -- | Sets the horizontal and vertical pixels-per-em (PPEM) of a font. -- -- These values are used for pixel-size-specific adjustment to -- shaping and draw results, though for the most part they are -- unused and can be left unset. -- -- /Since: 0.9.2/ fontSetPpem :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@xPpem@/: Horizontal ppem value to assign -> Word32 -- ^ /@yPpem@/: Vertical ppem value to assign -> m () fontSetPpem :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> m () fontSetPpem FontT font Word32 xPpem Word32 yPpem = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font hb_font_set_ppem font' xPpem yPpem touchManagedPtr font return () -- function font_set_parent -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "parent" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The parent font object to assign" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_parent" hb_font_set_parent :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr HarfBuzz.FontT.FontT -> -- parent : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO () -- | Sets the parent font of /@font@/. -- -- /Since: 1.0.5/ fontSetParent :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> HarfBuzz.FontT.FontT -- ^ /@parent@/: The parent font object to assign -> m () fontSetParent :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> FontT -> m () fontSetParent FontT font FontT parent = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font parent' <- unsafeManagedPtrGetPtr parent hb_font_set_parent font' parent' touchManagedPtr font touchManagedPtr parent return () -- function font_set_funcs_using -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The name of the font-functions structure to use, or `NULL`" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_set_funcs_using" hb_font_set_funcs_using :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CString -> -- name : TBasicType TUTF8 IO Int32 -- | Sets the font-functions structure to use for a font, based on the -- specified name. -- -- If /@name@/ is @NULL@ or the empty string, the default (first) functioning font-functions -- are used. This default can be changed by setting the @HB_FONT_FUNCS@ environment -- variable to the name of the desired font-functions. -- -- /Since: 11.0.0/ fontSetFuncsUsing :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> T.Text -- ^ /@name@/: The name of the font-functions structure to use, or @NULL@ -> m Int32 -- ^ __Returns:__ @true@ if the font-functions was found and set, @false@ otherwise fontSetFuncsUsing :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Text -> m Int32 fontSetFuncsUsing FontT font Text name = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font name' <- textToCString name result <- hb_font_set_funcs_using font' name' touchManagedPtr font freeMem name' return result -- function font_set_face -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_face_t to assign" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_set_face" hb_font_set_face :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO () -- | Sets /@face@/ as the font-face value of /@font@/. -- -- /Since: 1.4.3/ fontSetFace :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> HarfBuzz.FaceT.FaceT -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to assign -> m () fontSetFace :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> FaceT -> m () fontSetFace FontT font FaceT face = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font face' <- unsafeManagedPtrGetPtr face hb_font_set_face font' face' touchManagedPtr font touchManagedPtr face return () -- function font_paint_glyph_or_fail -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "pfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_paint_funcs_t to paint with" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "User data to pass to paint callbacks" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "palette_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the font's color palette to use" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "foreground" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_color_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The foreground color, unpremultipled" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_paint_glyph_or_fail" hb_font_paint_glyph_or_fail :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- pfuncs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Word32 -> -- palette_index : TBasicType TUInt Word32 -> -- foreground : TBasicType TUInt32 IO Int32 -- | Paints a color glyph. -- -- This function is similar to, but lower-level than, -- 'GI.HarfBuzz.Functions.fontPaintGlyph'. It is suitable for clients that -- need more control. If there are no color glyphs available, -- it will return @false@. The client can then fall back to -- 'GI.HarfBuzz.Functions.fontDrawGlyphOrFail' for the monochrome outline glyph. -- -- The painting instructions are returned by way of calls to -- the callbacks of the /@funcs@/ object, with /@paintData@/ passed -- to them. -- -- If the font has color palettes (see 'GI.HarfBuzz.Functions.otColorHasPalettes'), -- then /@paletteIndex@/ selects the palette to use. If the font only -- has one palette, this will be 0. -- -- /Since: 11.2.0/ fontPaintGlyphOrFail :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID -> HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@pfuncs@/: t'GI.HarfBuzz.Structs.PaintFuncsT.PaintFuncsT' to paint with -> Ptr () -- ^ /@paintData@/: User data to pass to paint callbacks -> Word32 -- ^ /@paletteIndex@/: The index of the font\'s color palette to use -> Word32 -- ^ /@foreground@/: The foreground color, unpremultipled -> m Int32 -- ^ __Returns:__ @true@ if glyph was painted, @false@ otherwise fontPaintGlyphOrFail :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> PaintFuncsT -> Ptr () -> Word32 -> Word32 -> m Int32 fontPaintGlyphOrFail FontT font Word32 glyph PaintFuncsT pfuncs Ptr () paintData Word32 paletteIndex Word32 foreground = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font pfuncs' <- unsafeManagedPtrGetPtr pfuncs result <- hb_font_paint_glyph_or_fail font' glyph pfuncs' paintData paletteIndex foreground touchManagedPtr font touchManagedPtr pfuncs return result -- function font_paint_glyph -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "pfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "paint_funcs_t" } -- , argCType = Just "hb_paint_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_paint_funcs_t to paint with" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "paint_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "User data to pass to paint callbacks" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "palette_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the font's color palette to use" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "foreground" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_color_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The foreground color, unpremultipled" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_paint_glyph" hb_font_paint_glyph :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Ptr HarfBuzz.PaintFuncsT.PaintFuncsT -> -- pfuncs : TInterface (Name {namespace = "HarfBuzz", name = "paint_funcs_t"}) Ptr () -> -- paint_data : TBasicType TPtr Word32 -> -- palette_index : TBasicType TUInt Word32 -> -- foreground : TBasicType TUInt32 IO () -- | Paints the glyph. This function is similar to -- 'GI.HarfBuzz.Functions.fontPaintGlyphOrFail', but if painting a color glyph -- failed, it will fall back to painting an outline monochrome -- glyph. -- -- The painting instructions are returned by way of calls to -- the callbacks of the /@funcs@/ object, with /@paintData@/ passed -- to them. -- -- If the font has color palettes (see 'GI.HarfBuzz.Functions.otColorHasPalettes'), -- then /@paletteIndex@/ selects the palette to use. If the font only -- has one palette, this will be 0. -- -- /Since: 7.0.0/ fontPaintGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID -> HarfBuzz.PaintFuncsT.PaintFuncsT -- ^ /@pfuncs@/: t'GI.HarfBuzz.Structs.PaintFuncsT.PaintFuncsT' to paint with -> Ptr () -- ^ /@paintData@/: User data to pass to paint callbacks -> Word32 -- ^ /@paletteIndex@/: The index of the font\'s color palette to use -> Word32 -- ^ /@foreground@/: The foreground color, unpremultipled -> m () fontPaintGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> PaintFuncsT -> Ptr () -> Word32 -> Word32 -> m () fontPaintGlyph FontT font Word32 glyph PaintFuncsT pfuncs Ptr () paintData Word32 paletteIndex Word32 foreground = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font pfuncs' <- unsafeManagedPtrGetPtr pfuncs hb_font_paint_glyph font' glyph pfuncs' paintData paletteIndex foreground touchManagedPtr font touchManagedPtr pfuncs return () -- function font_make_immutable -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_make_immutable" hb_font_make_immutable :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO () -- | Makes /@font@/ immutable. -- -- /Since: 0.9.2/ fontMakeImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m () fontMakeImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m () fontMakeImmutable FontT font = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font hb_font_make_immutable font' touchManagedPtr font return () -- function font_list_funcs -- Args: [] -- Lengths: [] -- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "hb_font_list_funcs" hb_font_list_funcs :: IO (Ptr CString) -- | Retrieves the list of font functions supported by HarfBuzz. -- -- /Since: 11.0.0/ fontListFuncs :: (B.CallStack.HasCallStack, MonadIO m) => m [T.Text] -- ^ __Returns:__ a -- @NULL@-terminated array of supported font functions -- constant strings. The returned array is owned by HarfBuzz -- and should not be modified or freed. fontListFuncs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [Text] fontListFuncs = IO [Text] -> m [Text] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text] forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr (Ptr CChar)) hb_font_list_funcs checkUnexpectedReturnNULL "fontListFuncs" result result' <- unpackZeroTerminatedUTF8CArray result return result' -- function font_is_synthetic -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_is_synthetic" hb_font_is_synthetic :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO Int32 -- | Tests whether a font is synthetic. A synthetic font is one -- that has either synthetic slant or synthetic bold set on it. -- -- /Since: 11.2.0/ fontIsSynthetic :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if the font is synthetic, @false@ otherwise. fontIsSynthetic :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Int32 fontIsSynthetic FontT font = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_is_synthetic font' touchManagedPtr font return result -- function font_is_immutable -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_is_immutable" hb_font_is_immutable :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO Int32 -- | Tests whether a font object is immutable. -- -- /Since: 0.9.2/ fontIsImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if /@font@/ is immutable, @false@ otherwise fontIsImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Int32 fontIsImmutable FontT font = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_is_immutable font' touchManagedPtr font return result -- function font_glyph_to_string -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "s" -- , argType = TCArray False (-1) 3 (TBasicType TUTF8) -- , argCType = Just "char*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The string containing the glyph name" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Length of string @s" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Length of string @s" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_glyph_to_string" hb_font_glyph_to_string :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Ptr (Ptr CString) -> -- s : TCArray False (-1) 3 (TBasicType TUTF8) Ptr Word32 -> -- size : TBasicType TUInt IO () -- | Fetches the name of the specified glyph ID in /@font@/ and returns -- it in string /@s@/. -- -- If the glyph ID has no name in /@font@/, a string of the form @gidDDD@ is -- generated, with @DDD@ being the glyph ID. -- -- According to the OpenType specification, glyph names are limited to 63 -- characters and can only contain (a subset of) ASCII. -- -- /Since: 0.9.2/ fontGlyphToString :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> m ([T.Text]) fontGlyphToString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m [Text] fontGlyphToString FontT font Word32 glyph = IO [Text] -> m [Text] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text] forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font s <- callocMem :: IO (Ptr (Ptr CString)) size <- allocMem :: IO (Ptr Word32) hb_font_glyph_to_string font' glyph s size size' <- peek size s' <- peek s s'' <- (unpackUTF8CArrayWithLength size') s' (mapCArrayWithLength size') freeMem s' freeMem s' touchManagedPtr font freeMem s freeMem size return s'' -- function font_glyph_from_string -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "s" -- , argType = TCArray False (-1) 2 (TBasicType TUInt8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "string to query" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The length of the string @s" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The glyph ID corresponding to the string requested" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The length of the string @s" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_glyph_from_string" hb_font_glyph_from_string :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr Word8 -> -- s : TCArray False (-1) 2 (TBasicType TUInt8) Int32 -> -- len : TBasicType TInt Ptr Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Fetches the glyph ID from /@font@/ that matches the specified string. -- Strings of the format @gidDDD@ or @uniUUUU@ are parsed automatically. -- -- \<note>Note: /@len@/ == -1 means the string is null-terminated.\<\/note> -- -- /Since: 0.9.2/ fontGlyphFromString :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> ByteString -- ^ /@s@/: string to query -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGlyphFromString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> ByteString -> m (Int32, Word32) fontGlyphFromString FontT font ByteString s = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do let len :: Int32 len = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString s font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font s' <- packByteString s glyph <- allocMem :: IO (Ptr Word32) result <- hb_font_glyph_from_string font' s' len glyph glyph' <- peek glyph touchManagedPtr font freeMem s' freeMem glyph return (result, glyph') -- function font_get_variation_glyph -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "unicode" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "variation_selector" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The variation-selector code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_variation_glyph" hb_font_get_variation_glyph :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- unicode : TBasicType TUInt32 Word32 -> -- variation_selector : TBasicType TUInt32 Ptr Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Fetches the glyph ID for a Unicode code point when followed by -- by the specified variation-selector code point, in the specified -- font. -- -- /Since: 1.2.3/ fontGetVariationGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@unicode@/: The Unicode code point to query -> Word32 -- ^ /@variationSelector@/: The variation-selector code point to query -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetVariationGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> m (Int32, Word32) fontGetVariationGlyph FontT font Word32 unicode Word32 variationSelector = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font glyph <- allocMem :: IO (Ptr Word32) result <- hb_font_get_variation_glyph font' unicode variationSelector glyph glyph' <- peek glyph touchManagedPtr font freeMem glyph return (result, glyph') -- function font_get_var_named_instance -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a font." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_var_named_instance" hb_font_get_var_named_instance :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO Word32 -- | Returns the currently-set named-instance index of the font. -- -- /Since: 7.0.0/ fontGetVarNamedInstance :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: a font. -> m Word32 -- ^ __Returns:__ Named-instance index or 'GI.HarfBuzz.Constants.FONT_NO_VAR_NAMED_INSTANCE'. fontGetVarNamedInstance :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Word32 fontGetVarNamedInstance FontT font = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_get_var_named_instance font' touchManagedPtr font return result -- function font_get_var_coords_normalized -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Number of coordinates retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_var_coords_normalized" hb_font_get_var_coords_normalized :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr Word32 -> -- length : TBasicType TUInt IO Int32 -- | Fetches the list of normalized variation coordinates currently -- set on a font. -- -- \<note>Note that if no variation coordinates are set, this function may -- return 'P.Nothing'.\<\/note> -- -- Return value is valid as long as variation coordinates of the font -- are not modified. -- -- /Since: 1.4.2/ fontGetVarCoordsNormalized :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m ((Int32, Word32)) -- ^ __Returns:__ coordinates array fontGetVarCoordsNormalized :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m (Int32, Word32) fontGetVarCoordsNormalized FontT font = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font length_ <- allocMem :: IO (Ptr Word32) result <- hb_font_get_var_coords_normalized font' length_ length_' <- peek length_ touchManagedPtr font freeMem length_ return (result, length_') -- function font_get_var_coords_design -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Number of coordinates retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TFloat) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_var_coords_design" hb_font_get_var_coords_design :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr Word32 -> -- length : TBasicType TUInt IO CFloat -- | Fetches the list of variation coordinates (in design-space units) currently -- set on a font. -- -- \<note>Note that if no variation coordinates are set, this function may -- return 'P.Nothing'.\<\/note> -- -- \<note>If variations have been set on the font using normalized coordinates -- (i.e. via 'GI.HarfBuzz.Functions.fontSetVarCoordsNormalized'), the design coordinates will -- have NaN (Not a Number) values.\<\/note> -- -- Return value is valid as long as variation coordinates of the font -- are not modified. -- -- /Since: 3.3.0/ fontGetVarCoordsDesign :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m ((Float, Word32)) -- ^ __Returns:__ coordinates array fontGetVarCoordsDesign :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m (Float, Word32) fontGetVarCoordsDesign FontT font = IO (Float, Word32) -> m (Float, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Float, Word32) -> m (Float, Word32)) -> IO (Float, Word32) -> m (Float, Word32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font length_ <- allocMem :: IO (Ptr Word32) result <- hb_font_get_var_coords_design font' length_ let result' = CFloat -> Float forall a b. (Real a, Fractional b) => a -> b realToFrac CFloat result length_' <- peek length_ touchManagedPtr font freeMem length_ return (result', length_') -- function font_get_v_extents -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "extents" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "font_extents_t" } -- , argCType = Just "hb_font_extents_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The font extents retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_v_extents" hb_font_get_v_extents :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr HarfBuzz.FontExtentsT.FontExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "font_extents_t"}) IO Int32 -- | Fetches the extents for a specified font, for vertical -- text segments. -- -- /Since: 1.1.3/ fontGetVExtents :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m ((Int32, HarfBuzz.FontExtentsT.FontExtentsT)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetVExtents :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m (Int32, FontExtentsT) fontGetVExtents FontT font = IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT)) -> IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font extents <- SP.callocBytes 48 :: IO (Ptr HarfBuzz.FontExtentsT.FontExtentsT) result <- hb_font_get_v_extents font' extents extents' <- (wrapPtr HarfBuzz.FontExtentsT.FontExtentsT) extents touchManagedPtr font return (result, extents') -- function font_get_synthetic_slant -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TFloat) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_synthetic_slant" hb_font_get_synthetic_slant :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO CFloat -- | Fetches the \"synthetic slant\" of a font. -- -- /Since: 3.3.0/ fontGetSyntheticSlant :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m Float -- ^ __Returns:__ Synthetic slant. By default is zero. fontGetSyntheticSlant :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Float fontGetSyntheticSlant FontT font = IO Float -> m Float forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Float -> m Float) -> IO Float -> m Float forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_get_synthetic_slant font' let result' = CFloat -> Float forall a b. (Real a, Fractional b) => a -> b realToFrac CFloat result touchManagedPtr font return result' -- function font_get_synthetic_bold -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x_embolden" -- , argType = TBasicType TFloat -- , argCType = Just "float*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "return location for horizontal value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y_embolden" -- , argType = TBasicType TFloat -- , argCType = Just "float*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "return location for vertical value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "in_place" -- , argType = TBasicType TInt -- , argCType = Just "hb_bool_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "return location for in-place value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_get_synthetic_bold" hb_font_get_synthetic_bold :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr CFloat -> -- x_embolden : TBasicType TFloat Ptr CFloat -> -- y_embolden : TBasicType TFloat Ptr Int32 -> -- in_place : TBasicType TInt IO () -- | Fetches the \"synthetic boldness\" parameters of a font. -- -- /Since: 7.0.0/ fontGetSyntheticBold :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m ((Float, Float, Int32)) fontGetSyntheticBold :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m (Float, Float, Int32) fontGetSyntheticBold FontT font = IO (Float, Float, Int32) -> m (Float, Float, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Float, Float, Int32) -> m (Float, Float, Int32)) -> IO (Float, Float, Int32) -> m (Float, Float, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font xEmbolden <- allocMem :: IO (Ptr CFloat) yEmbolden <- allocMem :: IO (Ptr CFloat) inPlace <- allocMem :: IO (Ptr Int32) hb_font_get_synthetic_bold font' xEmbolden yEmbolden inPlace xEmbolden' <- peek xEmbolden let xEmbolden'' = CFloat -> Float forall a b. (Real a, Fractional b) => a -> b realToFrac CFloat xEmbolden' yEmbolden' <- peek yEmbolden let yEmbolden'' = CFloat -> Float forall a b. (Real a, Fractional b) => a -> b realToFrac CFloat yEmbolden' inPlace' <- peek inPlace touchManagedPtr font freeMem xEmbolden freeMem yEmbolden freeMem inPlace return (xEmbolden'', yEmbolden'', inPlace') -- function font_get_serial -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_serial" hb_font_get_serial :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO Word32 -- | Returns the internal serial number of the font. The serial -- number is increased every time a setting on the font is -- changed, using a setter function. -- -- /Since: 4.4.0/ fontGetSerial :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m Word32 -- ^ __Returns:__ serial number fontGetSerial :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Word32 fontGetSerial FontT font = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_get_serial font' touchManagedPtr font return result -- function font_get_scale -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x_scale" -- , argType = TBasicType TInt -- , argCType = Just "int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Horizontal scale value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y_scale" -- , argType = TBasicType TInt -- , argCType = Just "int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Vertical scale value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_get_scale" hb_font_get_scale :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr Int32 -> -- x_scale : TBasicType TInt Ptr Int32 -> -- y_scale : TBasicType TInt IO () -- | Fetches the horizontal and vertical scale of a font. -- -- /Since: 0.9.2/ fontGetScale :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m ((Int32, Int32)) fontGetScale :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m (Int32, Int32) fontGetScale FontT font = IO (Int32, Int32) -> m (Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32) -> m (Int32, Int32)) -> IO (Int32, Int32) -> m (Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font xScale <- allocMem :: IO (Ptr Int32) yScale <- allocMem :: IO (Ptr Int32) hb_font_get_scale font' xScale yScale xScale' <- peek xScale yScale' <- peek yScale touchManagedPtr font freeMem xScale freeMem yScale return (xScale', yScale') -- function font_get_ptem -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TFloat) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_ptem" hb_font_get_ptem :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO CFloat -- | Fetches the \"point size\" of a font. Used in CoreText to -- implement optical sizing. -- -- /Since: 1.6.0/ fontGetPtem :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m Float -- ^ __Returns:__ Point size. A value of zero means \"not set.\" fontGetPtem :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Float fontGetPtem FontT font = IO Float -> m Float forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Float -> m Float) -> IO Float -> m Float forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_get_ptem font' let result' = CFloat -> Float forall a b. (Real a, Fractional b) => a -> b realToFrac CFloat result touchManagedPtr font return result' -- function font_get_ppem -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x_ppem" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Horizontal ppem value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y_ppem" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Vertical ppem value" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_get_ppem" hb_font_get_ppem :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr Word32 -> -- x_ppem : TBasicType TUInt Ptr Word32 -> -- y_ppem : TBasicType TUInt IO () -- | Fetches the horizontal and vertical points-per-em (ppem) of a font. -- -- /Since: 0.9.2/ fontGetPpem :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m ((Word32, Word32)) fontGetPpem :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m (Word32, Word32) fontGetPpem FontT font = IO (Word32, Word32) -> m (Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, Word32) -> m (Word32, Word32)) -> IO (Word32, Word32) -> m (Word32, Word32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font xPpem <- allocMem :: IO (Ptr Word32) yPpem <- allocMem :: IO (Ptr Word32) hb_font_get_ppem font' xPpem yPpem xPpem' <- peek xPpem yPpem' <- peek yPpem touchManagedPtr font freeMem xPpem freeMem yPpem return (xPpem', yPpem') -- function font_get_parent -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "font_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_parent" hb_font_get_parent :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO (Ptr HarfBuzz.FontT.FontT) -- | Fetches the parent font of /@font@/. -- -- /Since: 0.9.2/ fontGetParent :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m HarfBuzz.FontT.FontT -- ^ __Returns:__ The parent font object fontGetParent :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m FontT fontGetParent FontT font = IO FontT -> m FontT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FontT -> m FontT) -> IO FontT -> m FontT forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_get_parent font' checkUnexpectedReturnNULL "fontGetParent" result result' <- (newBoxed HarfBuzz.FontT.FontT) result touchManagedPtr font return result' -- function font_get_nominal_glyphs -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "number of code points to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_unicode" -- , argType = TBasicType TUInt32 -- , argCType = Just "const hb_codepoint_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first Unicode code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "unicode_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive code points" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first glyph ID retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "glyph_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive glyph IDs" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_nominal_glyphs" hb_font_get_nominal_glyphs :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- count : TBasicType TUInt Word32 -> -- first_unicode : TBasicType TUInt32 Word32 -> -- unicode_stride : TBasicType TUInt Ptr Word32 -> -- first_glyph : TBasicType TUInt32 Word32 -> -- glyph_stride : TBasicType TUInt IO Word32 -- | Fetches the nominal glyph IDs for a sequence of Unicode code points. Glyph -- IDs must be returned in a @/hb_codepoint_t/@ output parameter. Stops at the -- first unsupported glyph ID. -- -- /Since: 2.6.3/ fontGetNominalGlyphs :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@count@/: number of code points to query -> Word32 -- ^ /@firstUnicode@/: The first Unicode code point to query -> Word32 -- ^ /@unicodeStride@/: The stride between successive code points -> Word32 -- ^ /@glyphStride@/: The stride between successive glyph IDs -> m ((Word32, Word32)) -- ^ __Returns:__ the number of code points processed fontGetNominalGlyphs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> Word32 -> Word32 -> m (Word32, Word32) fontGetNominalGlyphs FontT font Word32 count Word32 firstUnicode Word32 unicodeStride Word32 glyphStride = IO (Word32, Word32) -> m (Word32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, Word32) -> m (Word32, Word32)) -> IO (Word32, Word32) -> m (Word32, Word32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font firstGlyph <- allocMem :: IO (Ptr Word32) result <- hb_font_get_nominal_glyphs font' count firstUnicode unicodeStride firstGlyph glyphStride firstGlyph' <- peek firstGlyph touchManagedPtr font freeMem firstGlyph return (result, firstGlyph') -- function font_get_nominal_glyph -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "unicode" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_nominal_glyph" hb_font_get_nominal_glyph :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- unicode : TBasicType TUInt32 Ptr Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Fetches the nominal glyph ID for a Unicode code point in the -- specified font. -- -- This version of the function should not be used to fetch glyph IDs -- for code points modified by variation selectors. For variation-selector -- support, user 'GI.HarfBuzz.Functions.fontGetVariationGlyph' or use 'GI.HarfBuzz.Functions.fontGetGlyph'. -- -- /Since: 1.2.3/ fontGetNominalGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@unicode@/: The Unicode code point to query -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetNominalGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m (Int32, Word32) fontGetNominalGlyph FontT font Word32 unicode = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font glyph <- allocMem :: IO (Ptr Word32) result <- hb_font_get_nominal_glyph font' unicode glyph glyph' <- peek glyph touchManagedPtr font freeMem glyph return (result, glyph') -- function font_get_h_extents -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "extents" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "font_extents_t" } -- , argCType = Just "hb_font_extents_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The font extents retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_h_extents" hb_font_get_h_extents :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr HarfBuzz.FontExtentsT.FontExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "font_extents_t"}) IO Int32 -- | Fetches the extents for a specified font, for horizontal -- text segments. -- -- /Since: 1.1.3/ fontGetHExtents :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m ((Int32, HarfBuzz.FontExtentsT.FontExtentsT)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetHExtents :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m (Int32, FontExtentsT) fontGetHExtents FontT font = IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT)) -> IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font extents <- SP.callocBytes 48 :: IO (Ptr HarfBuzz.FontExtentsT.FontExtentsT) result <- hb_font_get_h_extents font' extents extents' <- (wrapPtr HarfBuzz.FontExtentsT.FontExtentsT) extents touchManagedPtr font return (result, extents') -- function font_get_glyph_v_origins -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The number of glyph IDs in the sequence queried" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "const hb_codepoint_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive glyph IDs" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_x" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The first X coordinate of the origin retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "x_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive X coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_y" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The first Y coordinate of the origin retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive Y coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_v_origins" hb_font_get_glyph_v_origins :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- count : TBasicType TUInt Word32 -> -- first_glyph : TBasicType TUInt32 Word32 -> -- glyph_stride : TBasicType TUInt Ptr Int32 -> -- first_x : TBasicType TInt32 Word32 -> -- x_stride : TBasicType TUInt Ptr Int32 -> -- first_y : TBasicType TInt32 Word32 -> -- y_stride : TBasicType TUInt IO Int32 -- | Fetches the (X,Y) coordinates of the origin for requested glyph IDs -- in the specified font, for vertical text segments. -- -- /Since: 11.3.0/ fontGetGlyphVOrigins :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@count@/: The number of glyph IDs in the sequence queried -> Word32 -- ^ /@firstGlyph@/: The first glyph ID to query -> Word32 -- ^ /@glyphStride@/: The stride between successive glyph IDs -> Word32 -- ^ /@xStride@/: The stride between successive X coordinates -> Word32 -- ^ /@yStride@/: The stride between successive Y coordinates -> m ((Int32, Int32, Int32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetGlyphVOrigins :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> Word32 -> Word32 -> Word32 -> m (Int32, Int32, Int32) fontGetGlyphVOrigins FontT font Word32 count Word32 firstGlyph Word32 glyphStride Word32 xStride Word32 yStride = IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)) -> IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font firstX <- allocMem :: IO (Ptr Int32) firstY <- allocMem :: IO (Ptr Int32) result <- hb_font_get_glyph_v_origins font' count firstGlyph glyphStride firstX xStride firstY yStride firstX' <- peek firstX firstY' <- peek firstY touchManagedPtr font freeMem firstX freeMem firstY return (result, firstX', firstY') -- function font_get_glyph_v_origin -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The X coordinate of the origin" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Y coordinate of the origin" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_v_origin" hb_font_get_glyph_v_origin :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Ptr Int32 -> -- x : TBasicType TInt32 Ptr Int32 -> -- y : TBasicType TInt32 IO Int32 -- | Fetches the (X,Y) coordinates of the origin for a glyph ID -- in the specified font, for vertical text segments. -- -- /Since: 0.9.2/ fontGetGlyphVOrigin :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> m ((Int32, Int32, Int32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetGlyphVOrigin :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m (Int32, Int32, Int32) fontGetGlyphVOrigin FontT font Word32 glyph = IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)) -> IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font x <- allocMem :: IO (Ptr Int32) y <- allocMem :: IO (Ptr Int32) result <- hb_font_get_glyph_v_origin font' glyph x y x' <- peek x y' <- peek y touchManagedPtr font freeMem x freeMem y return (result, x', y') -- function font_get_glyph_v_kerning -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "top_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The glyph ID of the top glyph in the glyph pair" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "bottom_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The glyph ID of the bottom glyph in the glyph pair" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_v_kerning" hb_font_get_glyph_v_kerning :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- top_glyph : TBasicType TUInt32 Word32 -> -- bottom_glyph : TBasicType TUInt32 IO Int32 {-# DEPRECATED fontGetGlyphVKerning ["(Since version 2.0.0)"] #-} -- | Fetches the kerning-adjustment value for a glyph-pair in -- the specified font, for vertical text segments. -- -- \<note>It handles legacy kerning only (as returned by the corresponding -- t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' function).\<\/note> -- -- /Since: 0.9.2/ fontGetGlyphVKerning :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@topGlyph@/: The glyph ID of the top glyph in the glyph pair -> Word32 -- ^ /@bottomGlyph@/: The glyph ID of the bottom glyph in the glyph pair -> m Int32 -- ^ __Returns:__ The kerning adjustment value fontGetGlyphVKerning :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> m Int32 fontGetGlyphVKerning FontT font Word32 topGlyph Word32 bottomGlyph = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_get_glyph_v_kerning font' topGlyph bottomGlyph touchManagedPtr font return result -- function font_get_glyph_v_advances -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The number of glyph IDs in the sequence queried" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "const hb_codepoint_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive glyph IDs" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_advance" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first advance retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "advance_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive advances" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_v_advances" hb_font_get_glyph_v_advances :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- count : TBasicType TUInt Word32 -> -- first_glyph : TBasicType TUInt32 Word32 -> -- glyph_stride : TBasicType TUInt Ptr Int32 -> -- first_advance : TBasicType TInt32 Ptr Word32 -> -- advance_stride : TBasicType TUInt IO () -- | Fetches the advances for a sequence of glyph IDs in the specified -- font, for vertical text segments. -- -- /Since: 1.8.6/ fontGetGlyphVAdvances :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@count@/: The number of glyph IDs in the sequence queried -> Word32 -- ^ /@firstGlyph@/: The first glyph ID to query -> Word32 -- ^ /@glyphStride@/: The stride between successive glyph IDs -> m ((Int32, Word32)) fontGetGlyphVAdvances :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> Word32 -> m (Int32, Word32) fontGetGlyphVAdvances FontT font Word32 count Word32 firstGlyph Word32 glyphStride = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font firstAdvance <- allocMem :: IO (Ptr Int32) advanceStride <- allocMem :: IO (Ptr Word32) hb_font_get_glyph_v_advances font' count firstGlyph glyphStride firstAdvance advanceStride firstAdvance' <- peek firstAdvance advanceStride' <- peek advanceStride touchManagedPtr font freeMem firstAdvance freeMem advanceStride return (firstAdvance', advanceStride') -- function font_get_glyph_v_advance -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_v_advance" hb_font_get_glyph_v_advance :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Fetches the advance for a glyph ID in the specified font, -- for vertical text segments. -- -- /Since: 0.9.2/ fontGetGlyphVAdvance :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> m Int32 -- ^ __Returns:__ The advance of /@glyph@/ within /@font@/ fontGetGlyphVAdvance :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m Int32 fontGetGlyphVAdvance FontT font Word32 glyph = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_get_glyph_v_advance font' glyph touchManagedPtr font return result -- function font_get_glyph_shape -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "dfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" } -- , argCType = Just "hb_draw_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_draw_funcs_t to draw to" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "draw_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "User data to pass to draw callbacks" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_shape" hb_font_get_glyph_shape :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Ptr HarfBuzz.DrawFuncsT.DrawFuncsT -> -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"}) Ptr () -> -- draw_data : TBasicType TPtr IO () {-# DEPRECATED fontGetGlyphShape ["(Since version 7.0.0)","Use 'GI.HarfBuzz.Functions.fontDrawGlyph' instead"] #-} -- | Fetches the glyph shape that corresponds to a glyph in the specified /@font@/. -- The shape is returned by way of calls to the callbacks of the /@dfuncs@/ -- objects, with /@drawData@/ passed to them. -- -- /Since: 4.0.0/ fontGetGlyphShape :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID -> HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ /@dfuncs@/: t'GI.HarfBuzz.Structs.DrawFuncsT.DrawFuncsT' to draw to -> Ptr () -- ^ /@drawData@/: User data to pass to draw callbacks -> m () fontGetGlyphShape :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> DrawFuncsT -> Ptr () -> m () fontGetGlyphShape FontT font Word32 glyph DrawFuncsT dfuncs Ptr () drawData = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font dfuncs' <- unsafeManagedPtrGetPtr dfuncs hb_font_get_glyph_shape font' glyph dfuncs' drawData touchManagedPtr font touchManagedPtr dfuncs return () -- function font_get_glyph_origin_for_direction -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The direction of the text segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The X coordinate retrieved for the origin" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Y coordinate retrieved for the origin" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_origin_for_direction" hb_font_get_glyph_origin_for_direction :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Ptr Int32 -> -- x : TBasicType TInt32 Ptr Int32 -> -- y : TBasicType TInt32 IO () -- | Fetches the (X,Y) coordinates of the origin for a glyph in -- the specified font. -- -- Calls the appropriate direction-specific variant (horizontal -- or vertical) depending on the value of /@direction@/. -- -- /Since: 0.9.2/ fontGetGlyphOriginForDirection :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The direction of the text segment -> m ((Int32, Int32)) fontGetGlyphOriginForDirection :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> DirectionT -> m (Int32, Int32) fontGetGlyphOriginForDirection FontT font Word32 glyph DirectionT direction = IO (Int32, Int32) -> m (Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32) -> m (Int32, Int32)) -> IO (Int32, Int32) -> m (Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction x <- allocMem :: IO (Ptr Int32) y <- allocMem :: IO (Ptr Int32) hb_font_get_glyph_origin_for_direction font' glyph direction' x y x' <- peek x y' <- peek y touchManagedPtr font freeMem x freeMem y return (x', y') -- function font_get_glyph_name -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name" -- , argType = TCArray False (-1) 3 (TBasicType TUTF8) -- , argCType = Just "char*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Name string retrieved for the glyph ID" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Length of the glyph-name string retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Length of the glyph-name string retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_name" hb_font_get_glyph_name :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Ptr (Ptr CString) -> -- name : TCArray False (-1) 3 (TBasicType TUTF8) Ptr Word32 -> -- size : TBasicType TUInt IO Int32 -- | Fetches the glyph-name string for a glyph ID in the specified /@font@/. -- -- According to the OpenType specification, glyph names are limited to 63 -- characters and can only contain (a subset of) ASCII. -- -- /Since: 0.9.2/ fontGetGlyphName :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> m ((Int32, [T.Text])) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetGlyphName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m (Int32, [Text]) fontGetGlyphName FontT font Word32 glyph = IO (Int32, [Text]) -> m (Int32, [Text]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, [Text]) -> m (Int32, [Text])) -> IO (Int32, [Text]) -> m (Int32, [Text]) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font name <- callocMem :: IO (Ptr (Ptr CString)) size <- allocMem :: IO (Ptr Word32) result <- hb_font_get_glyph_name font' glyph name size size' <- peek size name' <- peek name name'' <- (unpackUTF8CArrayWithLength size') name' (mapCArrayWithLength size') freeMem name' freeMem name' touchManagedPtr font freeMem name freeMem size return (result, name'') -- function font_get_glyph_kerning_for_direction -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The glyph ID of the first glyph in the glyph pair to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "second_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The glyph ID of the second glyph in the glyph pair to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The direction of the text segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The horizontal kerning-adjustment value retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The vertical kerning-adjustment value retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_kerning_for_direction" hb_font_get_glyph_kerning_for_direction :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- first_glyph : TBasicType TUInt32 Word32 -> -- second_glyph : TBasicType TUInt32 CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Ptr Int32 -> -- x : TBasicType TInt32 Ptr Int32 -> -- y : TBasicType TInt32 IO () -- | Fetches the kerning-adjustment value for a glyph-pair in the specified font. -- -- Calls the appropriate direction-specific variant (horizontal -- or vertical) depending on the value of /@direction@/. -- -- /Since: 0.9.2/ fontGetGlyphKerningForDirection :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@firstGlyph@/: The glyph ID of the first glyph in the glyph pair to query -> Word32 -- ^ /@secondGlyph@/: The glyph ID of the second glyph in the glyph pair to query -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The direction of the text segment -> m ((Int32, Int32)) fontGetGlyphKerningForDirection :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> DirectionT -> m (Int32, Int32) fontGetGlyphKerningForDirection FontT font Word32 firstGlyph Word32 secondGlyph DirectionT direction = IO (Int32, Int32) -> m (Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32) -> m (Int32, Int32)) -> IO (Int32, Int32) -> m (Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction x <- allocMem :: IO (Ptr Int32) y <- allocMem :: IO (Ptr Int32) hb_font_get_glyph_kerning_for_direction font' firstGlyph secondGlyph direction' x y x' <- peek x y' <- peek y touchManagedPtr font freeMem x freeMem y return (x', y') -- function font_get_glyph_h_origins -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The number of glyph IDs in the sequence queried" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "const hb_codepoint_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive glyph IDs" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_x" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The first X coordinate of the origin retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "x_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive X coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_y" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The first Y coordinate of the origin retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive Y coordinates" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_h_origins" hb_font_get_glyph_h_origins :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- count : TBasicType TUInt Word32 -> -- first_glyph : TBasicType TUInt32 Word32 -> -- glyph_stride : TBasicType TUInt Ptr Int32 -> -- first_x : TBasicType TInt32 Word32 -> -- x_stride : TBasicType TUInt Ptr Int32 -> -- first_y : TBasicType TInt32 Word32 -> -- y_stride : TBasicType TUInt IO Int32 -- | Fetches the (X,Y) coordinates of the origin for requested glyph IDs -- in the specified font, for horizontal text segments. -- -- /Since: 11.3.0/ fontGetGlyphHOrigins :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@count@/: The number of glyph IDs in the sequence queried -> Word32 -- ^ /@firstGlyph@/: The first glyph ID to query -> Word32 -- ^ /@glyphStride@/: The stride between successive glyph IDs -> Word32 -- ^ /@xStride@/: The stride between successive X coordinates -> Word32 -- ^ /@yStride@/: The stride between successive Y coordinates -> m ((Int32, Int32, Int32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetGlyphHOrigins :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> Word32 -> Word32 -> Word32 -> m (Int32, Int32, Int32) fontGetGlyphHOrigins FontT font Word32 count Word32 firstGlyph Word32 glyphStride Word32 xStride Word32 yStride = IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)) -> IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font firstX <- allocMem :: IO (Ptr Int32) firstY <- allocMem :: IO (Ptr Int32) result <- hb_font_get_glyph_h_origins font' count firstGlyph glyphStride firstX xStride firstY yStride firstX' <- peek firstX firstY' <- peek firstY touchManagedPtr font freeMem firstX freeMem firstY return (result, firstX', firstY') -- function font_get_glyph_h_origin -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The X coordinate of the origin" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Y coordinate of the origin" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_h_origin" hb_font_get_glyph_h_origin :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Ptr Int32 -> -- x : TBasicType TInt32 Ptr Int32 -> -- y : TBasicType TInt32 IO Int32 -- | Fetches the (X,Y) coordinates of the origin for a glyph ID -- in the specified font, for horizontal text segments. -- -- /Since: 0.9.2/ fontGetGlyphHOrigin :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> m ((Int32, Int32, Int32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetGlyphHOrigin :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m (Int32, Int32, Int32) fontGetGlyphHOrigin FontT font Word32 glyph = IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)) -> IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font x <- allocMem :: IO (Ptr Int32) y <- allocMem :: IO (Ptr Int32) result <- hb_font_get_glyph_h_origin font' glyph x y x' <- peek x y' <- peek y touchManagedPtr font freeMem x freeMem y return (result, x', y') -- function font_get_glyph_h_kerning -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "left_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The glyph ID of the left glyph in the glyph pair" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "right_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The glyph ID of the right glyph in the glyph pair" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_h_kerning" hb_font_get_glyph_h_kerning :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- left_glyph : TBasicType TUInt32 Word32 -> -- right_glyph : TBasicType TUInt32 IO Int32 -- | Fetches the kerning-adjustment value for a glyph-pair in -- the specified font, for horizontal text segments. -- -- \<note>It handles legacy kerning only (as returned by the corresponding -- t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' function).\<\/note> -- -- /Since: 0.9.2/ fontGetGlyphHKerning :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@leftGlyph@/: The glyph ID of the left glyph in the glyph pair -> Word32 -- ^ /@rightGlyph@/: The glyph ID of the right glyph in the glyph pair -> m Int32 -- ^ __Returns:__ The kerning adjustment value fontGetGlyphHKerning :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> m Int32 fontGetGlyphHKerning FontT font Word32 leftGlyph Word32 rightGlyph = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_get_glyph_h_kerning font' leftGlyph rightGlyph touchManagedPtr font return result -- function font_get_glyph_h_advances -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The number of glyph IDs in the sequence queried" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "const hb_codepoint_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive glyph IDs" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_advance" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first advance retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "advance_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive advances" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_h_advances" hb_font_get_glyph_h_advances :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- count : TBasicType TUInt Word32 -> -- first_glyph : TBasicType TUInt32 Word32 -> -- glyph_stride : TBasicType TUInt Ptr Int32 -> -- first_advance : TBasicType TInt32 Word32 -> -- advance_stride : TBasicType TUInt IO () -- | Fetches the advances for a sequence of glyph IDs in the specified -- font, for horizontal text segments. -- -- /Since: 1.8.6/ fontGetGlyphHAdvances :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@count@/: The number of glyph IDs in the sequence queried -> Word32 -- ^ /@firstGlyph@/: The first glyph ID to query -> Word32 -- ^ /@glyphStride@/: The stride between successive glyph IDs -> Word32 -- ^ /@advanceStride@/: The stride between successive advances -> m (Int32) fontGetGlyphHAdvances :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> Word32 -> Word32 -> m Int32 fontGetGlyphHAdvances FontT font Word32 count Word32 firstGlyph Word32 glyphStride Word32 advanceStride = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font firstAdvance <- allocMem :: IO (Ptr Int32) hb_font_get_glyph_h_advances font' count firstGlyph glyphStride firstAdvance advanceStride firstAdvance' <- peek firstAdvance touchManagedPtr font freeMem firstAdvance return firstAdvance' -- function font_get_glyph_h_advance -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt32) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_h_advance" hb_font_get_glyph_h_advance :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Fetches the advance for a glyph ID in the specified font, -- for horizontal text segments. -- -- /Since: 0.9.2/ fontGetGlyphHAdvance :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> m Int32 -- ^ __Returns:__ The advance of /@glyph@/ within /@font@/ fontGetGlyphHAdvance :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m Int32 fontGetGlyphHAdvance FontT font Word32 glyph = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_get_glyph_h_advance font' glyph touchManagedPtr font return result -- function font_get_glyph_from_name -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name" -- , argType = TCArray False (-1) 2 (TBasicType TUTF8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The name string to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The length of the name queried" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The length of the name queried" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_from_name" hb_font_get_glyph_from_name :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Ptr CString -> -- name : TCArray False (-1) 2 (TBasicType TUTF8) Int32 -> -- len : TBasicType TInt Ptr Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Fetches the glyph ID that corresponds to a name string in the specified /@font@/. -- -- \<note>Note: /@len@/ == -1 means the name string is null-terminated.\<\/note> -- -- /Since: 0.9.2/ fontGetGlyphFromName :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> [T.Text] -- ^ /@name@/: The name string to query -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetGlyphFromName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> [Text] -> m (Int32, Word32) fontGetGlyphFromName FontT font [Text] name = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do let len :: Int32 len = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Text] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Text] name font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font name' <- packUTF8CArray name glyph <- allocMem :: IO (Ptr Word32) result <- hb_font_get_glyph_from_name font' name' len glyph glyph' <- peek glyph touchManagedPtr font (mapCArrayWithLength len) freeMem name' freeMem name' freeMem glyph return (result, glyph') -- function font_get_glyph_extents_for_origin -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The direction of the text segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "extents" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "glyph_extents_t" } -- , argCType = Just "hb_glyph_extents_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_glyph_extents_t retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_extents_for_origin" hb_font_get_glyph_extents_for_origin :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Ptr HarfBuzz.GlyphExtentsT.GlyphExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "glyph_extents_t"}) IO Int32 -- | Fetches the t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT' data for a glyph ID -- in the specified font, with respect to the origin in -- a text segment in the specified direction. -- -- Calls the appropriate direction-specific variant (horizontal -- or vertical) depending on the value of /@direction@/. -- -- /Since: 0.9.2/ fontGetGlyphExtentsForOrigin :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The direction of the text segment -> m ((Int32, HarfBuzz.GlyphExtentsT.GlyphExtentsT)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetGlyphExtentsForOrigin :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> DirectionT -> m (Int32, GlyphExtentsT) fontGetGlyphExtentsForOrigin FontT font Word32 glyph DirectionT direction = IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT)) -> IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction extents <- SP.callocBytes 16 :: IO (Ptr HarfBuzz.GlyphExtentsT.GlyphExtentsT) result <- hb_font_get_glyph_extents_for_origin font' glyph direction' extents extents' <- (wrapPtr HarfBuzz.GlyphExtentsT.GlyphExtentsT) extents touchManagedPtr font return (result, extents') -- function font_get_glyph_extents -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "extents" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "glyph_extents_t" } -- , argCType = Just "hb_glyph_extents_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_glyph_extents_t retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_extents" hb_font_get_glyph_extents :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Ptr HarfBuzz.GlyphExtentsT.GlyphExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "glyph_extents_t"}) IO Int32 -- | Fetches the t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT' data for a glyph ID -- in the specified font. -- -- /Since: 0.9.2/ fontGetGlyphExtents :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> m ((Int32, HarfBuzz.GlyphExtentsT.GlyphExtentsT)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetGlyphExtents :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> m (Int32, GlyphExtentsT) fontGetGlyphExtents FontT font Word32 glyph = IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT)) -> IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font extents <- SP.callocBytes 16 :: IO (Ptr HarfBuzz.GlyphExtentsT.GlyphExtentsT) result <- hb_font_get_glyph_extents font' glyph extents extents' <- (wrapPtr HarfBuzz.GlyphExtentsT.GlyphExtentsT) extents touchManagedPtr font return (result, extents') -- function font_get_glyph_contour_point_for_origin -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "point_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The contour-point index to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The direction of the text segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The X value retrieved for the contour point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Y value retrieved for the contour point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_contour_point_for_origin" hb_font_get_glyph_contour_point_for_origin :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Word32 -> -- point_index : TBasicType TUInt CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Ptr Int32 -> -- x : TBasicType TInt32 Ptr Int32 -> -- y : TBasicType TInt32 IO Int32 -- | Fetches the (X,Y) coordinates of a specified contour-point index -- in the specified glyph ID in the specified font, with respect -- to the origin in a text segment in the specified direction. -- -- Calls the appropriate direction-specific variant (horizontal -- or vertical) depending on the value of /@direction@/. -- -- /Since: 0.9.2/ fontGetGlyphContourPointForOrigin :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> Word32 -- ^ /@pointIndex@/: The contour-point index to query -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The direction of the text segment -> m ((Int32, Int32, Int32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetGlyphContourPointForOrigin :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> DirectionT -> m (Int32, Int32, Int32) fontGetGlyphContourPointForOrigin FontT font Word32 glyph Word32 pointIndex DirectionT direction = IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)) -> IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction x <- allocMem :: IO (Ptr Int32) y <- allocMem :: IO (Ptr Int32) result <- hb_font_get_glyph_contour_point_for_origin font' glyph pointIndex direction' x y x' <- peek x y' <- peek y touchManagedPtr font freeMem x freeMem y return (result, x', y') -- function font_get_glyph_contour_point -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "point_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The contour-point index to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The X value retrieved for the contour point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Y value retrieved for the contour point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_contour_point" hb_font_get_glyph_contour_point :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Word32 -> -- point_index : TBasicType TUInt Ptr Int32 -> -- x : TBasicType TInt32 Ptr Int32 -> -- y : TBasicType TInt32 IO Int32 -- | Fetches the (x,y) coordinates of a specified contour-point index -- in the specified glyph, within the specified font. -- -- /Since: 0.9.2/ fontGetGlyphContourPoint :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> Word32 -- ^ /@pointIndex@/: The contour-point index to query -> m ((Int32, Int32, Int32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetGlyphContourPoint :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> m (Int32, Int32, Int32) fontGetGlyphContourPoint FontT font Word32 glyph Word32 pointIndex = IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)) -> IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font x <- allocMem :: IO (Ptr Int32) y <- allocMem :: IO (Ptr Int32) result <- hb_font_get_glyph_contour_point font' glyph pointIndex x y x' <- peek x y' <- peek y touchManagedPtr font freeMem x freeMem y return (result, x', y') -- function font_get_glyph_advances_for_direction -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The direction of the text segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The number of glyph IDs in the sequence queried" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "const hb_codepoint_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive glyph IDs" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "first_advance" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The first advance retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "advance_stride" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The stride between successive advances" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_advances_for_direction" hb_font_get_glyph_advances_for_direction :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Word32 -> -- count : TBasicType TUInt Word32 -> -- first_glyph : TBasicType TUInt32 Word32 -> -- glyph_stride : TBasicType TUInt Ptr Int32 -> -- first_advance : TBasicType TInt32 Ptr Word32 -> -- advance_stride : TBasicType TUInt IO () -- | Fetches the advances for a sequence of glyph IDs in the specified -- font, in a text segment of the specified direction. -- -- Calls the appropriate direction-specific variant (horizontal -- or vertical) depending on the value of /@direction@/. -- -- /Since: 1.8.6/ fontGetGlyphAdvancesForDirection :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The direction of the text segment -> Word32 -- ^ /@count@/: The number of glyph IDs in the sequence queried -> Word32 -- ^ /@firstGlyph@/: The first glyph ID to query -> Word32 -- ^ /@glyphStride@/: The stride between successive glyph IDs -> m ((Int32, Word32)) fontGetGlyphAdvancesForDirection :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> DirectionT -> Word32 -> Word32 -> Word32 -> m (Int32, Word32) fontGetGlyphAdvancesForDirection FontT font DirectionT direction Word32 count Word32 firstGlyph Word32 glyphStride = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction firstAdvance <- allocMem :: IO (Ptr Int32) advanceStride <- allocMem :: IO (Ptr Word32) hb_font_get_glyph_advances_for_direction font' direction' count firstGlyph glyphStride firstAdvance advanceStride firstAdvance' <- peek firstAdvance advanceStride' <- peek advanceStride touchManagedPtr font freeMem firstAdvance freeMem advanceStride return (firstAdvance', advanceStride') -- function font_get_glyph_advance_for_direction -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The direction of the text segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The horizontal advance retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The vertical advance retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph_advance_for_direction" hb_font_get_glyph_advance_for_direction :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Ptr Int32 -> -- x : TBasicType TInt32 Ptr Int32 -> -- y : TBasicType TInt32 IO () -- | Fetches the advance for a glyph ID from the specified font, -- in a text segment of the specified direction. -- -- Calls the appropriate direction-specific variant (horizontal -- or vertical) depending on the value of /@direction@/. -- -- /Since: 0.9.2/ fontGetGlyphAdvanceForDirection :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The direction of the text segment -> m ((Int32, Int32)) fontGetGlyphAdvanceForDirection :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> DirectionT -> m (Int32, Int32) fontGetGlyphAdvanceForDirection FontT font Word32 glyph DirectionT direction = IO (Int32, Int32) -> m (Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32) -> m (Int32, Int32)) -> IO (Int32, Int32) -> m (Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction x <- allocMem :: IO (Ptr Int32) y <- allocMem :: IO (Ptr Int32) hb_font_get_glyph_advance_for_direction font' glyph direction' x y x' <- peek x y' <- peek y touchManagedPtr font freeMem x freeMem y return (x', y') -- function font_get_glyph -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "unicode" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode code point to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "variation_selector" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A variation-selector code point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_glyph" hb_font_get_glyph :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- unicode : TBasicType TUInt32 Word32 -> -- variation_selector : TBasicType TUInt32 Ptr Word32 -> -- glyph : TBasicType TUInt32 IO Int32 -- | Fetches the glyph ID for a Unicode code point in the specified -- font, with an optional variation selector. -- -- If /@variationSelector@/ is 0, calls 'GI.HarfBuzz.Functions.fontGetNominalGlyph'; -- otherwise calls 'GI.HarfBuzz.Functions.fontGetVariationGlyph'. -- -- /Since: 0.9.2/ fontGetGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@unicode@/: The Unicode code point to query -> Word32 -- ^ /@variationSelector@/: A variation-selector code point -> m ((Int32, Word32)) -- ^ __Returns:__ @true@ if data found, @false@ otherwise fontGetGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> Word32 -> m (Int32, Word32) fontGetGlyph FontT font Word32 unicode Word32 variationSelector = IO (Int32, Word32) -> m (Int32, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Word32) -> m (Int32, Word32)) -> IO (Int32, Word32) -> m (Int32, Word32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font glyph <- allocMem :: IO (Ptr Word32) result <- hb_font_get_glyph font' unicode variationSelector glyph glyph' <- peek glyph touchManagedPtr font freeMem glyph return (result, glyph') -- function font_get_face -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_face" hb_font_get_face :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO (Ptr HarfBuzz.FaceT.FaceT) -- | Fetches the face associated with the specified font object. -- -- /Since: 0.9.2/ fontGetFace :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ The t'GI.HarfBuzz.Structs.FaceT.FaceT' value fontGetFace :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m FaceT fontGetFace FontT font = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font result <- hb_font_get_face font' checkUnexpectedReturnNULL "fontGetFace" result result' <- (newBoxed HarfBuzz.FaceT.FaceT) result touchManagedPtr font return result' -- function font_get_extents_for_direction -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The direction of the text segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "extents" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "font_extents_t" } -- , argCType = Just "hb_font_extents_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_font_extents_t retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_get_extents_for_direction" hb_font_get_extents_for_direction :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Ptr HarfBuzz.FontExtentsT.FontExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "font_extents_t"}) IO () -- | Fetches the extents for a font in a text segment of the -- specified direction. -- -- Calls the appropriate direction-specific variant (horizontal -- or vertical) depending on the value of /@direction@/. -- -- /Since: 1.1.3/ fontGetExtentsForDirection :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The direction of the text segment -> m (HarfBuzz.FontExtentsT.FontExtentsT) fontGetExtentsForDirection :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> DirectionT -> m FontExtentsT fontGetExtentsForDirection FontT font DirectionT direction = IO FontExtentsT -> m FontExtentsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FontExtentsT -> m FontExtentsT) -> IO FontExtentsT -> m FontExtentsT forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction extents <- SP.callocBytes 48 :: IO (Ptr HarfBuzz.FontExtentsT.FontExtentsT) hb_font_get_extents_for_direction font' direction' extents extents' <- (wrapPtr HarfBuzz.FontExtentsT.FontExtentsT) extents touchManagedPtr font return extents' -- function font_get_empty -- Args: [] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "font_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_font_get_empty" hb_font_get_empty :: IO (Ptr HarfBuzz.FontT.FontT) -- | Fetches the empty font object. -- -- /Since: 0.9.2/ fontGetEmpty :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.FontT.FontT -- ^ __Returns:__ The empty font object fontGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m FontT fontGetEmpty = IO FontT -> m FontT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FontT -> m FontT) -> IO FontT -> m FontT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr FontT) hb_font_get_empty checkUnexpectedReturnNULL "fontGetEmpty" result result' <- (wrapBoxed HarfBuzz.FontT.FontT) result return result' -- function font_funcs_set_variation_glyph_func -- XXX Could not generate function font_funcs_set_variation_glyph_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_paint_glyph_or_fail_func -- XXX Could not generate function font_funcs_set_paint_glyph_or_fail_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_paint_glyph_func -- XXX Could not generate function font_funcs_set_paint_glyph_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_nominal_glyphs_func -- XXX Could not generate function font_funcs_set_nominal_glyphs_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_nominal_glyph_func -- XXX Could not generate function font_funcs_set_nominal_glyph_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_v_origins_func -- XXX Could not generate function font_funcs_set_glyph_v_origins_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_v_origin_func -- XXX Could not generate function font_funcs_set_glyph_v_origin_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_v_kerning_func -- XXX Could not generate function font_funcs_set_glyph_v_kerning_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_v_advances_func -- XXX Could not generate function font_funcs_set_glyph_v_advances_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_v_advance_func -- XXX Could not generate function font_funcs_set_glyph_v_advance_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_shape_func -- XXX Could not generate function font_funcs_set_glyph_shape_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_name_func -- XXX Could not generate function font_funcs_set_glyph_name_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_h_origins_func -- XXX Could not generate function font_funcs_set_glyph_h_origins_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_h_origin_func -- XXX Could not generate function font_funcs_set_glyph_h_origin_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_h_kerning_func -- XXX Could not generate function font_funcs_set_glyph_h_kerning_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_h_advances_func -- XXX Could not generate function font_funcs_set_glyph_h_advances_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_h_advance_func -- XXX Could not generate function font_funcs_set_glyph_h_advance_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_func -- XXX Could not generate function font_funcs_set_glyph_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_from_name_func -- XXX Could not generate function font_funcs_set_glyph_from_name_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_extents_func -- XXX Could not generate function font_funcs_set_glyph_extents_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_glyph_contour_point_func -- XXX Could not generate function font_funcs_set_glyph_contour_point_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_font_v_extents_func -- XXX Could not generate function font_funcs_set_font_v_extents_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_font_h_extents_func -- XXX Could not generate function font_funcs_set_font_h_extents_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_draw_glyph_or_fail_func -- XXX Could not generate function font_funcs_set_draw_glyph_or_fail_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_set_draw_glyph_func -- XXX Could not generate function font_funcs_set_draw_glyph_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function font_funcs_make_immutable -- Args: [ Arg -- { argCName = "ffuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_funcs_t" } -- , argCType = Just "hb_font_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The font-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_funcs_make_immutable" hb_font_funcs_make_immutable :: Ptr HarfBuzz.FontFuncsT.FontFuncsT -> -- ffuncs : TInterface (Name {namespace = "HarfBuzz", name = "font_funcs_t"}) IO () -- | Makes a font-functions structure immutable. -- -- /Since: 0.9.2/ fontFuncsMakeImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontFuncsT.FontFuncsT -- ^ /@ffuncs@/: The font-functions structure -> m () fontFuncsMakeImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontFuncsT -> m () fontFuncsMakeImmutable FontFuncsT ffuncs = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do ffuncs' <- FontFuncsT -> IO (Ptr FontFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontFuncsT ffuncs hb_font_funcs_make_immutable ffuncs' touchManagedPtr ffuncs return () -- function font_funcs_is_immutable -- Args: [ Arg -- { argCName = "ffuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_funcs_t" } -- , argCType = Just "hb_font_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The font-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_funcs_is_immutable" hb_font_funcs_is_immutable :: Ptr HarfBuzz.FontFuncsT.FontFuncsT -> -- ffuncs : TInterface (Name {namespace = "HarfBuzz", name = "font_funcs_t"}) IO Int32 -- | Tests whether a font-functions structure is immutable. -- -- /Since: 0.9.2/ fontFuncsIsImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontFuncsT.FontFuncsT -- ^ /@ffuncs@/: The font-functions structure -> m Int32 -- ^ __Returns:__ @true@ if /@ffuncs@/ is immutable, @false@ otherwise fontFuncsIsImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontFuncsT -> m Int32 fontFuncsIsImmutable FontFuncsT ffuncs = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do ffuncs' <- FontFuncsT -> IO (Ptr FontFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontFuncsT ffuncs result <- hb_font_funcs_is_immutable ffuncs' touchManagedPtr ffuncs return result -- function font_funcs_get_empty -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "font_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_font_funcs_get_empty" hb_font_funcs_get_empty :: IO (Ptr HarfBuzz.FontFuncsT.FontFuncsT) -- | Fetches an empty font-functions structure. -- -- /Since: 0.9.2/ fontFuncsGetEmpty :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.FontFuncsT.FontFuncsT -- ^ __Returns:__ The font-functions structure fontFuncsGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m FontFuncsT fontFuncsGetEmpty = IO FontFuncsT -> m FontFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FontFuncsT -> m FontFuncsT) -> IO FontFuncsT -> m FontFuncsT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr FontFuncsT) hb_font_funcs_get_empty checkUnexpectedReturnNULL "fontFuncsGetEmpty" result result' <- (wrapBoxed HarfBuzz.FontFuncsT.FontFuncsT) result return result' -- function font_funcs_create -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "font_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_font_funcs_create" hb_font_funcs_create :: IO (Ptr HarfBuzz.FontFuncsT.FontFuncsT) -- | Creates a new t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' structure of font functions. -- -- /Since: 0.9.2/ fontFuncsCreate :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.FontFuncsT.FontFuncsT -- ^ __Returns:__ The font-functions structure fontFuncsCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m FontFuncsT fontFuncsCreate = IO FontFuncsT -> m FontFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FontFuncsT -> m FontFuncsT) -> IO FontFuncsT -> m FontFuncsT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr FontFuncsT) hb_font_funcs_create checkUnexpectedReturnNULL "fontFuncsCreate" result result' <- (wrapBoxed HarfBuzz.FontFuncsT.FontFuncsT) result return result' -- function font_draw_glyph_or_fail -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "dfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" } -- , argCType = Just "hb_draw_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_draw_funcs_t to draw to" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "draw_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "User data to pass to draw callbacks" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_font_draw_glyph_or_fail" hb_font_draw_glyph_or_fail :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Ptr HarfBuzz.DrawFuncsT.DrawFuncsT -> -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"}) Ptr () -> -- draw_data : TBasicType TPtr IO Int32 -- | Draws the outline that corresponds to a glyph in the specified /@font@/. -- -- This is a newer name for 'GI.HarfBuzz.Functions.fontDrawGlyph', that returns @false@ -- if the font has no outlines for the glyph. -- -- The outline is returned by way of calls to the callbacks of the /@dfuncs@/ -- objects, with /@drawData@/ passed to them. -- -- /Since: 11.2.0/ fontDrawGlyphOrFail :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID -> HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ /@dfuncs@/: t'GI.HarfBuzz.Structs.DrawFuncsT.DrawFuncsT' to draw to -> Ptr () -- ^ /@drawData@/: User data to pass to draw callbacks -> m Int32 -- ^ __Returns:__ @true@ if glyph was drawn, @false@ otherwise fontDrawGlyphOrFail :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> DrawFuncsT -> Ptr () -> m Int32 fontDrawGlyphOrFail FontT font Word32 glyph DrawFuncsT dfuncs Ptr () drawData = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font dfuncs' <- unsafeManagedPtrGetPtr dfuncs result <- hb_font_draw_glyph_or_fail font' glyph dfuncs' drawData touchManagedPtr font touchManagedPtr dfuncs return result -- function font_draw_glyph -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "dfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" } -- , argCType = Just "hb_draw_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_draw_funcs_t to draw to" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "draw_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "User data to pass to draw callbacks" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_draw_glyph" hb_font_draw_glyph :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 Ptr HarfBuzz.DrawFuncsT.DrawFuncsT -> -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"}) Ptr () -> -- draw_data : TBasicType TPtr IO () -- | Draws the outline that corresponds to a glyph in the specified /@font@/. -- -- This is an older name for 'GI.HarfBuzz.Functions.fontDrawGlyphOrFail', with no -- return value. -- -- The outline is returned by way of calls to the callbacks of the /@dfuncs@/ -- objects, with /@drawData@/ passed to them. -- -- /Since: 7.0.0/ fontDrawGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID -> HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ /@dfuncs@/: t'GI.HarfBuzz.Structs.DrawFuncsT.DrawFuncsT' to draw to -> Ptr () -- ^ /@drawData@/: User data to pass to draw callbacks -> m () fontDrawGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> DrawFuncsT -> Ptr () -> m () fontDrawGlyph FontT font Word32 glyph DrawFuncsT dfuncs Ptr () drawData = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font dfuncs' <- unsafeManagedPtrGetPtr dfuncs hb_font_draw_glyph font' glyph dfuncs' drawData touchManagedPtr font touchManagedPtr dfuncs return () -- function font_create_sub_font -- Args: [ Arg -- { argCName = "parent" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The parent font object" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "font_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_font_create_sub_font" hb_font_create_sub_font :: Ptr HarfBuzz.FontT.FontT -> -- parent : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO (Ptr HarfBuzz.FontT.FontT) -- | Constructs a sub-font font object from the specified /@parent@/ font, -- replicating the parent\'s properties. -- -- /Since: 0.9.2/ fontCreateSubFont :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@parent@/: The parent font object -> m HarfBuzz.FontT.FontT -- ^ __Returns:__ The new sub-font font object fontCreateSubFont :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m FontT fontCreateSubFont FontT parent = IO FontT -> m FontT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FontT -> m FontT) -> IO FontT -> m FontT forall a b. (a -> b) -> a -> b $ do parent' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT parent result <- hb_font_create_sub_font parent' checkUnexpectedReturnNULL "fontCreateSubFont" result result' <- (wrapBoxed HarfBuzz.FontT.FontT) result touchManagedPtr parent return result' -- function font_create -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a face." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "font_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_font_create" hb_font_create :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO (Ptr HarfBuzz.FontT.FontT) -- | Constructs a new font object from the specified face. -- -- \<note>Note: If /@face@/\'s index value (as passed to 'GI.HarfBuzz.Functions.faceCreate' -- has non-zero top 16-bits, those bits minus one are passed to -- 'GI.HarfBuzz.Functions.fontSetVarNamedInstance', effectively loading a named-instance -- of a variable font, instead of the default-instance. This allows -- specifying which named-instance to load by default when creating the -- face.\<\/note> -- -- /Since: 0.9.2/ fontCreate :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: a face. -> m HarfBuzz.FontT.FontT -- ^ __Returns:__ The new font object fontCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m FontT fontCreate FaceT face = IO FontT -> m FontT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FontT -> m FontT) -> IO FontT -> m FontT forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_font_create face' checkUnexpectedReturnNULL "fontCreate" result result' <- (wrapBoxed HarfBuzz.FontT.FontT) result touchManagedPtr face return result' -- function font_changed -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_changed" hb_font_changed :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) IO () -- | Notifies the /@font@/ that underlying font data has changed. -- This has the effect of increasing the serial as returned -- by 'GI.HarfBuzz.Functions.fontGetSerial', which invalidates internal caches. -- -- /Since: 4.4.0/ fontChanged :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> m () fontChanged :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m () fontChanged FontT font = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font hb_font_changed font' touchManagedPtr font return () -- function font_add_glyph_origin_for_direction -- Args: [ Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_font_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph ID to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The direction of the text segment" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "x" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = The original X coordinate\n Output = The X coordinate plus the X-coordinate of the origin" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "y" -- , argType = TBasicType TInt32 -- , argCType = Just "hb_position_t*" -- , direction = DirectionInout -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = The original Y coordinate\n Output = The Y coordinate plus the Y-coordinate of the origin" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_font_add_glyph_origin_for_direction" hb_font_add_glyph_origin_for_direction :: Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) Word32 -> -- glyph : TBasicType TUInt32 CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) Ptr Int32 -> -- x : TBasicType TInt32 Ptr Int32 -> -- y : TBasicType TInt32 IO () -- | Adds the origin coordinates to an (X,Y) point coordinate, in -- the specified glyph ID in the specified font. -- -- Calls the appropriate direction-specific variant (horizontal -- or vertical) depending on the value of /@direction@/. -- -- /Since: 0.9.2/ fontAddGlyphOriginForDirection :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FontT.FontT -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon -> Word32 -- ^ /@glyph@/: The glyph ID to query -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The direction of the text segment -> Int32 -- ^ /@x@/: Input = The original X coordinate -- Output = The X coordinate plus the X-coordinate of the origin -> Int32 -- ^ /@y@/: Input = The original Y coordinate -- Output = The Y coordinate plus the Y-coordinate of the origin -> m ((Int32, Int32)) fontAddGlyphOriginForDirection :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> Word32 -> DirectionT -> Int32 -> Int32 -> m (Int32, Int32) fontAddGlyphOriginForDirection FontT font Word32 glyph DirectionT direction Int32 x Int32 y = IO (Int32, Int32) -> m (Int32, Int32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Int32) -> m (Int32, Int32)) -> IO (Int32, Int32) -> m (Int32, Int32) forall a b. (a -> b) -> a -> b $ do font' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT font let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction x' <- allocMem :: IO (Ptr Int32) poke x' x y' <- allocMem :: IO (Ptr Int32) poke y' y hb_font_add_glyph_origin_for_direction font' glyph direction' x' y' x'' <- peek x' y'' <- peek y' touchManagedPtr font freeMem x' freeMem y' return (x'', y'') -- function feature_to_string -- Args: [ Arg -- { argCName = "feature" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "feature_t" } -- , argCType = Just "hb_feature_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_feature_t to convert" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buf" -- , argType = TCArray False (-1) 2 (TBasicType TUTF8) -- , argCType = Just "char*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "output string" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the allocated size of @buf" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the allocated size of @buf" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_feature_to_string" hb_feature_to_string :: Ptr HarfBuzz.FeatureT.FeatureT -> -- feature : TInterface (Name {namespace = "HarfBuzz", name = "feature_t"}) Ptr (Ptr CString) -> -- buf : TCArray False (-1) 2 (TBasicType TUTF8) Ptr Word32 -> -- size : TBasicType TUInt IO () -- | Converts a t'GI.HarfBuzz.Structs.FeatureT.FeatureT' into a @NULL@-terminated string in the format -- understood by 'GI.HarfBuzz.Functions.featureFromString'. The client in responsible for -- allocating big enough size for /@buf@/, 128 bytes is more than enough. -- -- Note that the feature value will be omitted if it is \'1\', but the -- string won\'t include any whitespace. -- -- /Since: 0.9.5/ featureToString :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FeatureT.FeatureT -- ^ /@feature@/: an t'GI.HarfBuzz.Structs.FeatureT.FeatureT' to convert -> m ([T.Text]) featureToString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FeatureT -> m [Text] featureToString FeatureT feature = IO [Text] -> m [Text] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text] forall a b. (a -> b) -> a -> b $ do feature' <- FeatureT -> IO (Ptr FeatureT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FeatureT feature buf <- callocMem :: IO (Ptr (Ptr CString)) size <- allocMem :: IO (Ptr Word32) hb_feature_to_string feature' buf size size' <- peek size buf' <- peek buf buf'' <- (unpackUTF8CArrayWithLength size') buf' (mapCArrayWithLength size') freeMem buf' freeMem buf' touchManagedPtr feature freeMem buf freeMem size return buf'' -- function feature_from_string -- Args: [ Arg -- { argCName = "str" -- , argType = TCArray False (-1) 1 (TBasicType TUInt8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a string to parse" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "length of @str, or -1 if string is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "feature_t" } -- , argCType = Just "hb_feature_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the #hb_feature_t to initialize with the parsed values" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "length of @str, or -1 if string is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_feature_from_string" hb_feature_from_string :: Ptr Word8 -> -- str : TCArray False (-1) 1 (TBasicType TUInt8) Int32 -> -- len : TBasicType TInt Ptr HarfBuzz.FeatureT.FeatureT -> -- feature : TInterface (Name {namespace = "HarfBuzz", name = "feature_t"}) IO Int32 -- | Parses a string into a t'GI.HarfBuzz.Structs.FeatureT.FeatureT'. -- -- The format for specifying feature strings follows. All valid CSS -- font-feature-settings values other than \'normal\' and the global values are -- also accepted, though not documented below. CSS string escapes are not -- supported. -- -- The range indices refer to the positions between Unicode characters. The -- position before the first character is always 0. -- -- The format is Python-esque. Here is how it all works: -- -- \<informaltable pgwide=\'1\' align=\'left\' frame=\'none\'> -- \<tgroup cols=\'5\'> -- \<thead> -- \<row>\<entry>Syntax\<\/entry> \<entry>Value\<\/entry> \<entry>Start\<\/entry> \<entry>End\<\/entry>\<\/row> -- \<\/thead> -- \<tbody> -- \<row>\<entry>Setting value:\<\/entry>\<\/row> -- \<row>\<entry>kern\<\/entry> \<entry>1\<\/entry> \<entry>0\<\/entry> \<entry>∞\<\/entry> \<entry>Turn feature on\<\/entry>\<\/row> -- \<row>\<entry>+kern\<\/entry> \<entry>1\<\/entry> \<entry>0\<\/entry> \<entry>∞\<\/entry> \<entry>Turn feature on\<\/entry>\<\/row> -- \<row>\<entry>-kern\<\/entry> \<entry>0\<\/entry> \<entry>0\<\/entry> \<entry>∞\<\/entry> \<entry>Turn feature off\<\/entry>\<\/row> -- \<row>\<entry>kern=0\<\/entry> \<entry>0\<\/entry> \<entry>0\<\/entry> \<entry>∞\<\/entry> \<entry>Turn feature off\<\/entry>\<\/row> -- \<row>\<entry>kern=1\<\/entry> \<entry>1\<\/entry> \<entry>0\<\/entry> \<entry>∞\<\/entry> \<entry>Turn feature on\<\/entry>\<\/row> -- \<row>\<entry>aalt=2\<\/entry> \<entry>2\<\/entry> \<entry>0\<\/entry> \<entry>∞\<\/entry> \<entry>Choose 2nd alternate\<\/entry>\<\/row> -- \<row>\<entry>Setting index:\<\/entry>\<\/row> -- \<row>\<entry>kern[]\<\/entry> \<entry>1\<\/entry> \<entry>0\<\/entry> \<entry>∞\<\/entry> \<entry>Turn feature on\<\/entry>\<\/row> -- \<row>\<entry>kern[:]\<\/entry> \<entry>1\<\/entry> \<entry>0\<\/entry> \<entry>∞\<\/entry> \<entry>Turn feature on\<\/entry>\<\/row> -- \<row>\<entry>kern[5:]\<\/entry> \<entry>1\<\/entry> \<entry>5\<\/entry> \<entry>∞\<\/entry> \<entry>Turn feature on, partial\<\/entry>\<\/row> -- \<row>\<entry>kern[:5]\<\/entry> \<entry>1\<\/entry> \<entry>0\<\/entry> \<entry>5\<\/entry> \<entry>Turn feature on, partial\<\/entry>\<\/row> -- \<row>\<entry>kern[3:5]\<\/entry> \<entry>1\<\/entry> \<entry>3\<\/entry> \<entry>5\<\/entry> \<entry>Turn feature on, range\<\/entry>\<\/row> -- \<row>\<entry>kern[3]\<\/entry> \<entry>1\<\/entry> \<entry>3\<\/entry> \<entry>3+1\<\/entry> \<entry>Turn feature on, single char\<\/entry>\<\/row> -- \<row>\<entry>Mixing it all:\<\/entry>\<\/row> -- \<row>\<entry>aalt[3:5]=2\<\/entry> \<entry>2\<\/entry> \<entry>3\<\/entry> \<entry>5\<\/entry> \<entry>Turn 2nd alternate on for range\<\/entry>\<\/row> -- \<\/tbody> -- \<\/tgroup> -- \<\/informaltable> -- -- /Since: 0.9.5/ featureFromString :: (B.CallStack.HasCallStack, MonadIO m) => ByteString -- ^ /@str@/: a string to parse -> m ((Int32, HarfBuzz.FeatureT.FeatureT)) -- ^ __Returns:__ @true@ if /@str@/ is successfully parsed, @false@ otherwise featureFromString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ByteString -> m (Int32, FeatureT) featureFromString ByteString str = IO (Int32, FeatureT) -> m (Int32, FeatureT) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, FeatureT) -> m (Int32, FeatureT)) -> IO (Int32, FeatureT) -> m (Int32, FeatureT) forall a b. (a -> b) -> a -> b $ do let len :: Int32 len = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString str str' <- ByteString -> IO (Ptr Word8) packByteString ByteString str feature <- SP.callocBoxedBytes 16 :: IO (Ptr HarfBuzz.FeatureT.FeatureT) result <- hb_feature_from_string str' len feature feature' <- (wrapBoxed HarfBuzz.FeatureT.FeatureT) feature freeMem str' return (result, feature') -- function face_set_upem -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "upem" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The units-per-em value to assign" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_face_set_upem" hb_face_set_upem :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- upem : TBasicType TUInt IO () -- | Sets the units-per-em (upem) for a face object to the specified value. -- -- This API is used in rare circumstances. -- -- /Since: 0.9.2/ faceSetUpem :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object -> Word32 -- ^ /@upem@/: The units-per-em value to assign -> m () faceSetUpem :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m () faceSetUpem FaceT face Word32 upem = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face hb_face_set_upem face' upem touchManagedPtr face return () -- function face_set_index -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index to assign" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_face_set_index" hb_face_set_index :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- index : TBasicType TUInt IO () -- | Assigns the specified face-index to /@face@/. Fails if the -- face is immutable. -- -- \<note>Note: changing the index has no effect on the face itself -- This only changes the value returned by 'GI.HarfBuzz.Functions.faceGetIndex'.\<\/note> -- -- /Since: 0.9.2/ faceSetIndex :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object -> Word32 -- ^ /@index@/: The index to assign -> m () faceSetIndex :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m () faceSetIndex FaceT face Word32 index = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face hb_face_set_index face' index touchManagedPtr face return () -- function face_set_glyph_count -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "glyph_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The glyph-count value to assign" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_face_set_glyph_count" hb_face_set_glyph_count :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- glyph_count : TBasicType TUInt IO () -- | Sets the glyph count for a face object to the specified value. -- -- This API is used in rare circumstances. -- -- /Since: 0.9.7/ faceSetGlyphCount :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object -> Word32 -- ^ /@glyphCount@/: The glyph-count value to assign -> m () faceSetGlyphCount :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m () faceSetGlyphCount FaceT face Word32 glyphCount = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face hb_face_set_glyph_count face' glyphCount touchManagedPtr face return () -- function face_set_get_table_tags_func -- XXX Could not generate function face_set_get_table_tags_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function face_reference_table -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "const hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_tag_t of the table to query" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_face_reference_table" hb_face_reference_table :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- tag : TBasicType TUInt32 IO (Ptr HarfBuzz.BlobT.BlobT) -- | Fetches a reference to the specified table within -- the specified face. Returns an empty blob if referencing table data is not -- possible. -- -- /Since: 0.9.2/ faceReferenceTable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object -> Word32 -- ^ /@tag@/: The @/hb_tag_t/@ of the table to query -> m HarfBuzz.BlobT.BlobT -- ^ __Returns:__ A pointer to the /@tag@/ table within /@face@/ faceReferenceTable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m BlobT faceReferenceTable FaceT face Word32 tag = IO BlobT -> m BlobT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_face_reference_table face' tag checkUnexpectedReturnNULL "faceReferenceTable" result result' <- (wrapBoxed HarfBuzz.BlobT.BlobT) result touchManagedPtr face return result' -- function face_reference_blob -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_face_reference_blob" hb_face_reference_blob :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO (Ptr HarfBuzz.BlobT.BlobT) -- | Fetches a pointer to the binary blob that contains the specified face. -- If referencing the face data is not possible, this function creates a blob -- out of individual table blobs if 'GI.HarfBuzz.Functions.faceGetTableTags' works with this -- face, otherwise it returns an empty blob. -- -- /Since: 0.9.2/ faceReferenceBlob :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object -> m HarfBuzz.BlobT.BlobT -- ^ __Returns:__ A pointer to the blob for /@face@/ faceReferenceBlob :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m BlobT faceReferenceBlob FaceT face = IO BlobT -> m BlobT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_face_reference_blob face' checkUnexpectedReturnNULL "faceReferenceBlob" result result' <- (wrapBoxed HarfBuzz.BlobT.BlobT) result touchManagedPtr face return result' -- function face_make_immutable -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_face_make_immutable" hb_face_make_immutable :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO () -- | Makes the given face object immutable. -- -- /Since: 0.9.2/ faceMakeImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object -> m () faceMakeImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m () faceMakeImmutable FaceT face = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face hb_face_make_immutable face' touchManagedPtr face return () -- function face_list_loaders -- Args: [] -- Lengths: [] -- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "hb_face_list_loaders" hb_face_list_loaders :: IO (Ptr CString) -- | Retrieves the list of face loaders supported by HarfBuzz. -- -- /Since: 11.0.0/ faceListLoaders :: (B.CallStack.HasCallStack, MonadIO m) => m [T.Text] -- ^ __Returns:__ a -- @NULL@-terminated array of supported face loaders -- constant strings. The returned array is owned by HarfBuzz -- and should not be modified or freed. faceListLoaders :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [Text] faceListLoaders = IO [Text] -> m [Text] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text] forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr (Ptr CChar)) hb_face_list_loaders checkUnexpectedReturnNULL "faceListLoaders" result result' <- unpackZeroTerminatedUTF8CArray result return result' -- function face_is_immutable -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_face_is_immutable" hb_face_is_immutable :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether the given face object is immutable. -- -- /Since: 0.9.2/ faceIsImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object -> m Int32 -- ^ __Returns:__ @true@ is /@face@/ is immutable, @false@ otherwise faceIsImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 faceIsImmutable FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_face_is_immutable face' touchManagedPtr face return result -- function face_get_upem -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "const hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_face_get_upem" hb_face_get_upem :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Word32 -- | Fetches the units-per-em (UPEM) value of the specified face object. -- -- Typical UPEM values for fonts are 1000, or 2048, but any value -- in between 16 and 16,384 is allowed for OpenType fonts. -- -- /Since: 0.9.2/ faceGetUpem :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object -> m Word32 -- ^ __Returns:__ The upem value of /@face@/ faceGetUpem :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Word32 faceGetUpem FaceT face = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_face_get_upem face' touchManagedPtr face return result -- function face_get_table_tags -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "const hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of first table tag to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "table_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of table tags to return;\n Output = the actual number of table tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "table_tags" -- , argType = TCArray False (-1) 2 (TBasicType TUInt32) -- , argCType = Just "hb_tag_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The array of table tags found" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "table_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of table tags to return;\n Output = the actual number of table tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_face_get_table_tags" :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- start_offset : TBasicType TUInt Ptr Word32 -> -- table_count : TBasicType TUInt Ptr (Ptr Word32) -> -- table_tags : TCArray False (-1) 2 (TBasicType TUInt32) IO Word32 -- | Fetches a list of all table tags for a face, if possible. The list returned will -- begin at the offset provided -- -- /Since: 1.6.0/ faceGetTableTags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object -> Word32 -- ^ /@startOffset@/: The index of first table tag to retrieve -> m ((Word32, [Word32])) -- ^ __Returns:__ Total number of tables, or zero if it is not possible to list faceGetTableTags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> m (Word32, [Word32]) faceGetTableTags FaceT face Word32 startOffset = IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [Word32]) -> m (Word32, [Word32])) -> IO (Word32, [Word32]) -> m (Word32, [Word32]) forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face tableCount <- allocMem :: IO (Ptr Word32) tableTags <- callocMem :: IO (Ptr (Ptr Word32)) result <- hb_face_get_table_tags face' startOffset tableCount tableTags tableCount' <- peek tableCount tableTags' <- peek tableTags tableTags'' <- (unpackStorableArrayWithLength tableCount') tableTags' freeMem tableTags' touchManagedPtr face freeMem tableCount freeMem tableTags return (result, tableTags'') -- function face_get_index -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "const hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_face_get_index" hb_face_get_index :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Word32 -- | Fetches the face-index corresponding to the given face. -- -- \<note>Note: face indices within a collection are zero-based.\<\/note> -- -- /Since: 0.9.2/ faceGetIndex :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object -> m Word32 -- ^ __Returns:__ The index of /@face@/. faceGetIndex :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Word32 faceGetIndex FaceT face = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_face_get_index face' touchManagedPtr face return result -- function face_get_glyph_count -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "const hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A face object" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_face_get_glyph_count" hb_face_get_glyph_count :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Word32 -- | Fetches the glyph-count value of the specified face object. -- -- /Since: 0.9.7/ faceGetGlyphCount :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object -> m Word32 -- ^ __Returns:__ The glyph-count value of /@face@/ faceGetGlyphCount :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Word32 faceGetGlyphCount FaceT face = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_face_get_glyph_count face' touchManagedPtr face return result -- function face_get_empty -- Args: [] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_face_get_empty" hb_face_get_empty :: IO (Ptr HarfBuzz.FaceT.FaceT) -- | Fetches the singleton empty face object. -- -- /Since: 0.9.2/ faceGetEmpty :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ The empty face object faceGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m FaceT faceGetEmpty = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr FaceT) hb_face_get_empty checkUnexpectedReturnNULL "faceGetEmpty" result result' <- (wrapBoxed HarfBuzz.FaceT.FaceT) result return result' -- function face_create_or_fail_using -- Args: [ Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_blob_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the face within @blob" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "loader_name" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The name of the loader to use, or `NULL`" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_face_create_or_fail_using" hb_face_create_or_fail_using :: Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) Word32 -> -- index : TBasicType TUInt CString -> -- loader_name : TBasicType TUTF8 IO (Ptr HarfBuzz.FaceT.FaceT) -- | A thin wrapper around the face loader functions registered with HarfBuzz. -- If /@loaderName@/ is @NULL@ or the empty string, the first available loader -- is used. -- -- For example, the FreeType (\"ft\") loader might be able to load -- WOFF and WOFF2 files if FreeType is built with those features, -- whereas the OpenType (\"ot\") loader will not. -- -- /Since: 11.0.0/ faceCreateOrFailUsing :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@blob@/: t'GI.HarfBuzz.Structs.BlobT.BlobT' to work upon -> Word32 -- ^ /@index@/: The index of the face within /@blob@/ -> Maybe (T.Text) -- ^ /@loaderName@/: The name of the loader to use, or @NULL@ -> m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ The new face object, or @NULL@ if -- the loader fails to load the face. faceCreateOrFailUsing :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> Word32 -> Maybe Text -> m FaceT faceCreateOrFailUsing BlobT blob Word32 index Maybe Text loaderName = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do blob' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT blob maybeLoaderName <- case loaderName of Maybe Text Nothing -> Ptr CChar -> IO (Ptr CChar) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr CChar forall a. Ptr a FP.nullPtr Just Text jLoaderName -> do jLoaderName' <- Text -> IO (Ptr CChar) textToCString Text jLoaderName return jLoaderName' result <- hb_face_create_or_fail_using blob' index maybeLoaderName checkUnexpectedReturnNULL "faceCreateOrFailUsing" result result' <- (wrapBoxed HarfBuzz.FaceT.FaceT) result touchManagedPtr blob freeMem maybeLoaderName return result' -- function face_create_or_fail -- Args: [ Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_blob_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the face within @blob" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_face_create_or_fail" hb_face_create_or_fail :: Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) Word32 -> -- index : TBasicType TUInt IO (Ptr HarfBuzz.FaceT.FaceT) -- | Like 'GI.HarfBuzz.Functions.faceCreate', but returns @NULL@ if the blob data -- contains no usable font face at the specified index. -- -- /Since: 10.1.0/ faceCreateOrFail :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@blob@/: t'GI.HarfBuzz.Structs.BlobT.BlobT' to work upon -> Word32 -- ^ /@index@/: The index of the face within /@blob@/ -> m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ The new face object, or @NULL@ if -- no face is found at the specified index. faceCreateOrFail :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> Word32 -> m FaceT faceCreateOrFail BlobT blob Word32 index = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do blob' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT blob result <- hb_face_create_or_fail blob' index checkUnexpectedReturnNULL "faceCreateOrFail" result result' <- (wrapBoxed HarfBuzz.FaceT.FaceT) result touchManagedPtr blob return result' -- function face_create_from_file_or_fail_using -- Args: [ Arg -- { argCName = "file_name" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A font filename" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the face within the file" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "loader_name" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "The name of the loader to use, or `NULL`" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_face_create_from_file_or_fail_using" hb_face_create_from_file_or_fail_using :: CString -> -- file_name : TBasicType TUTF8 Word32 -> -- index : TBasicType TUInt CString -> -- loader_name : TBasicType TUTF8 IO (Ptr HarfBuzz.FaceT.FaceT) -- | A thin wrapper around the face loader functions registered with HarfBuzz. -- If /@loaderName@/ is @NULL@ or the empty string, the first available loader -- is used. -- -- For example, the FreeType (\"ft\") loader might be able to load -- WOFF and WOFF2 files if FreeType is built with those features, -- whereas the OpenType (\"ot\") loader will not. -- -- /Since: 11.0.0/ faceCreateFromFileOrFailUsing :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@fileName@/: A font filename -> Word32 -- ^ /@index@/: The index of the face within the file -> Maybe (T.Text) -- ^ /@loaderName@/: The name of the loader to use, or @NULL@ -> m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ The new face object, or @NULL@ if -- the file cannot be read or the loader fails to load the face. faceCreateFromFileOrFailUsing :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> Word32 -> Maybe Text -> m FaceT faceCreateFromFileOrFailUsing Text fileName Word32 index Maybe Text loaderName = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do fileName' <- Text -> IO (Ptr CChar) textToCString Text fileName maybeLoaderName <- case loaderName of Maybe Text Nothing -> Ptr CChar -> IO (Ptr CChar) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr CChar forall a. Ptr a FP.nullPtr Just Text jLoaderName -> do jLoaderName' <- Text -> IO (Ptr CChar) textToCString Text jLoaderName return jLoaderName' result <- hb_face_create_from_file_or_fail_using fileName' index maybeLoaderName checkUnexpectedReturnNULL "faceCreateFromFileOrFailUsing" result result' <- (wrapBoxed HarfBuzz.FaceT.FaceT) result freeMem fileName' freeMem maybeLoaderName return result' -- function face_create_from_file_or_fail -- Args: [ Arg -- { argCName = "file_name" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A font filename" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the face within the file" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_face_create_from_file_or_fail" hb_face_create_from_file_or_fail :: CString -> -- file_name : TBasicType TUTF8 Word32 -> -- index : TBasicType TUInt IO (Ptr HarfBuzz.FaceT.FaceT) -- | A thin wrapper around 'GI.HarfBuzz.Functions.blobCreateFromFileOrFail' -- followed by 'GI.HarfBuzz.Functions.faceCreateOrFail'. -- -- /Since: 10.1.0/ faceCreateFromFileOrFail :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@fileName@/: A font filename -> Word32 -- ^ /@index@/: The index of the face within the file -> m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ The new face object, or @NULL@ if -- no face is found at the specified index or the file cannot be read. faceCreateFromFileOrFail :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> Word32 -> m FaceT faceCreateFromFileOrFail Text fileName Word32 index = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do fileName' <- Text -> IO (Ptr CChar) textToCString Text fileName result <- hb_face_create_from_file_or_fail fileName' index checkUnexpectedReturnNULL "faceCreateFromFileOrFail" result result' <- (wrapBoxed HarfBuzz.FaceT.FaceT) result freeMem fileName' return result' -- function face_create_for_tables -- XXX Could not generate function face_create_for_tables -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function face_create -- Args: [ Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_blob_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The index of the face within @blob" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_face_create" hb_face_create :: Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) Word32 -> -- index : TBasicType TUInt IO (Ptr HarfBuzz.FaceT.FaceT) -- | Constructs a new face object from the specified blob and -- a face index into that blob. -- -- The face index is used for blobs of file formats such as TTC and -- DFont that can contain more than one face. Face indices within -- such collections are zero-based. -- -- \<note>Note: If the blob font format is not a collection, /@index@/ -- is ignored. Otherwise, only the lower 16-bits of /@index@/ are used. -- The unmodified /@index@/ can be accessed via 'GI.HarfBuzz.Functions.faceGetIndex'.\<\/note> -- -- \<note>Note: The high 16-bits of /@index@/, if non-zero, are used by -- 'GI.HarfBuzz.Functions.fontCreate' to load named-instances in variable fonts. See -- 'GI.HarfBuzz.Functions.fontCreate' for details.\<\/note> -- -- /Since: 0.9.2/ faceCreate :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@blob@/: t'GI.HarfBuzz.Structs.BlobT.BlobT' to work upon -> Word32 -- ^ /@index@/: The index of the face within /@blob@/ -> m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ The new face object faceCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> Word32 -> m FaceT faceCreate BlobT blob Word32 index = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do blob' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT blob result <- hb_face_create blob' index checkUnexpectedReturnNULL "faceCreate" result result' <- (wrapBoxed HarfBuzz.FaceT.FaceT) result touchManagedPtr blob return result' -- function face_count -- Args: [ Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a blob." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_face_count" hb_face_count :: Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) IO Word32 -- | Fetches the number of faces in a blob. -- -- /Since: 1.7.7/ faceCount :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@blob@/: a blob. -> m Word32 -- ^ __Returns:__ Number of faces in /@blob@/ faceCount :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> m Word32 faceCount BlobT blob = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do blob' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT blob result <- hb_face_count blob' touchManagedPtr blob return result -- function face_collect_variation_unicodes -- XXX Could not generate function face_collect_variation_unicodes -- Not implemented: Don't know how to allocate "out" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) -- function face_collect_variation_selectors -- XXX Could not generate function face_collect_variation_selectors -- Not implemented: Don't know how to allocate "out" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) -- function face_collect_unicodes -- XXX Could not generate function face_collect_unicodes -- Not implemented: Don't know how to allocate "out" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"}) -- function face_collect_nominal_glyph_mapping -- XXX Could not generate function face_collect_nominal_glyph_mapping -- Not implemented: Don't know how to allocate "mapping" of type TInterface (Name {namespace = "HarfBuzz", name = "map_t"}) -- function face_builder_sort_tables -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "A face object created with hb_face_builder_create()" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "tags" -- , argType = TCArray True (-1) (-1) (TBasicType TUInt32) -- , argCType = Just "const hb_tag_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "ordered list of table tags terminated by\n %HB_TAG_NONE" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_face_builder_sort_tables" hb_face_builder_sort_tables :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Ptr Word32 -> -- tags : TCArray True (-1) (-1) (TBasicType TUInt32) IO () -- | Set the ordering of tables for serialization. Any tables not -- specified in the tags list will be ordered after the tables in -- tags, ordered by the default sort ordering. -- -- /Since: 5.3.0/ faceBuilderSortTables :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object created with 'GI.HarfBuzz.Functions.faceBuilderCreate' -> [Word32] -- ^ /@tags@/: ordered list of table tags terminated by -- @/HB_TAG_NONE/@ -> m () faceBuilderSortTables :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> [Word32] -> m () faceBuilderSortTables FaceT face [Word32] tags = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face tags' <- packZeroTerminatedStorableArray tags hb_face_builder_sort_tables face' tags' touchManagedPtr face freeMem tags' return () -- function face_builder_create -- Args: [] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_face_builder_create" hb_face_builder_create :: IO (Ptr HarfBuzz.FaceT.FaceT) -- | Creates a t'GI.HarfBuzz.Structs.FaceT.FaceT' that can be used with 'GI.HarfBuzz.Functions.faceBuilderAddTable'. -- After tables are added to the face, it can be compiled to a binary -- font file by calling 'GI.HarfBuzz.Functions.faceReferenceBlob'. -- -- /Since: 1.9.0/ faceBuilderCreate :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.FaceT.FaceT -- ^ __Returns:__ New face. faceBuilderCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m FaceT faceBuilderCreate = IO FaceT -> m FaceT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr FaceT) hb_face_builder_create checkUnexpectedReturnNULL "faceBuilderCreate" result result' <- (wrapBoxed HarfBuzz.FaceT.FaceT) result return result' -- function face_builder_add_table -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "A face object created with hb_face_builder_create()" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "tag" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_tag_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_tag_t of the table to add" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The blob containing the table data to add" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_face_builder_add_table" hb_face_builder_add_table :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- tag : TBasicType TUInt32 Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) IO Int32 -- | Add table for /@tag@/ with data provided by /@blob@/ to the face. /@face@/ must -- be created using 'GI.HarfBuzz.Functions.faceBuilderCreate'. -- -- /Since: 1.9.0/ faceBuilderAddTable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: A face object created with 'GI.HarfBuzz.Functions.faceBuilderCreate' -> Word32 -- ^ /@tag@/: The @/hb_tag_t/@ of the table to add -> HarfBuzz.BlobT.BlobT -- ^ /@blob@/: The blob containing the table data to add -> m Int32 faceBuilderAddTable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> BlobT -> m Int32 faceBuilderAddTable FaceT face Word32 tag BlobT blob = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face blob' <- unsafeManagedPtrGetPtr blob result <- hb_face_builder_add_table face' tag blob' touchManagedPtr face touchManagedPtr blob return result -- function draw_quadratic_to -- Args: [ Arg -- { argCName = "dfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" } -- , argCType = Just "hb_draw_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "draw functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "draw_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated draw data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "st" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_state_t" } -- , argCType = Just "hb_draw_state_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "current draw state" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "control_x" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X component of control point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "control_y" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y component of control point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "to_x" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X component of target point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "to_y" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y component of target point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_draw_quadratic_to" hb_draw_quadratic_to :: Ptr HarfBuzz.DrawFuncsT.DrawFuncsT -> -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"}) Ptr () -> -- draw_data : TBasicType TPtr Ptr HarfBuzz.DrawStateT.DrawStateT -> -- st : TInterface (Name {namespace = "HarfBuzz", name = "draw_state_t"}) CFloat -> -- control_x : TBasicType TFloat CFloat -> -- control_y : TBasicType TFloat CFloat -> -- to_x : TBasicType TFloat CFloat -> -- to_y : TBasicType TFloat IO () -- | Perform a \"quadratic-to\" draw operation. -- -- /Since: 4.0.0/ drawQuadraticTo :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ /@dfuncs@/: draw functions -> Ptr () -- ^ /@drawData@/: associated draw data passed by the caller -> HarfBuzz.DrawStateT.DrawStateT -- ^ /@st@/: current draw state -> Float -- ^ /@controlX@/: X component of control point -> Float -- ^ /@controlY@/: Y component of control point -> Float -- ^ /@toX@/: X component of target point -> Float -- ^ /@toY@/: Y component of target point -> m () drawQuadraticTo :: forall (m :: * -> *). (HasCallStack, MonadIO m) => DrawFuncsT -> Ptr () -> DrawStateT -> Float -> Float -> Float -> Float -> m () drawQuadraticTo DrawFuncsT dfuncs Ptr () drawData DrawStateT st Float controlX Float controlY Float toX Float toY = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr DrawFuncsT dfuncs st' <- unsafeManagedPtrGetPtr st let controlX' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float controlX let controlY' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float controlY let toX' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float toX let toY' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float toY hb_draw_quadratic_to dfuncs' drawData st' controlX' controlY' toX' toY' touchManagedPtr dfuncs touchManagedPtr st return () -- function draw_move_to -- Args: [ Arg -- { argCName = "dfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" } -- , argCType = Just "hb_draw_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "draw functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "draw_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated draw data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "st" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_state_t" } -- , argCType = Just "hb_draw_state_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "current draw state" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "to_x" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X component of target point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "to_y" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y component of target point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_draw_move_to" hb_draw_move_to :: Ptr HarfBuzz.DrawFuncsT.DrawFuncsT -> -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"}) Ptr () -> -- draw_data : TBasicType TPtr Ptr HarfBuzz.DrawStateT.DrawStateT -> -- st : TInterface (Name {namespace = "HarfBuzz", name = "draw_state_t"}) CFloat -> -- to_x : TBasicType TFloat CFloat -> -- to_y : TBasicType TFloat IO () -- | Perform a \"move-to\" draw operation. -- -- /Since: 4.0.0/ drawMoveTo :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ /@dfuncs@/: draw functions -> Ptr () -- ^ /@drawData@/: associated draw data passed by the caller -> HarfBuzz.DrawStateT.DrawStateT -- ^ /@st@/: current draw state -> Float -- ^ /@toX@/: X component of target point -> Float -- ^ /@toY@/: Y component of target point -> m () drawMoveTo :: forall (m :: * -> *). (HasCallStack, MonadIO m) => DrawFuncsT -> Ptr () -> DrawStateT -> Float -> Float -> m () drawMoveTo DrawFuncsT dfuncs Ptr () drawData DrawStateT st Float toX Float toY = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr DrawFuncsT dfuncs st' <- unsafeManagedPtrGetPtr st let toX' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float toX let toY' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float toY hb_draw_move_to dfuncs' drawData st' toX' toY' touchManagedPtr dfuncs touchManagedPtr st return () -- function draw_line_to -- Args: [ Arg -- { argCName = "dfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" } -- , argCType = Just "hb_draw_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "draw functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "draw_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated draw data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "st" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_state_t" } -- , argCType = Just "hb_draw_state_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "current draw state" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "to_x" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X component of target point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "to_y" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y component of target point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_draw_line_to" hb_draw_line_to :: Ptr HarfBuzz.DrawFuncsT.DrawFuncsT -> -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"}) Ptr () -> -- draw_data : TBasicType TPtr Ptr HarfBuzz.DrawStateT.DrawStateT -> -- st : TInterface (Name {namespace = "HarfBuzz", name = "draw_state_t"}) CFloat -> -- to_x : TBasicType TFloat CFloat -> -- to_y : TBasicType TFloat IO () -- | Perform a \"line-to\" draw operation. -- -- /Since: 4.0.0/ drawLineTo :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ /@dfuncs@/: draw functions -> Ptr () -- ^ /@drawData@/: associated draw data passed by the caller -> HarfBuzz.DrawStateT.DrawStateT -- ^ /@st@/: current draw state -> Float -- ^ /@toX@/: X component of target point -> Float -- ^ /@toY@/: Y component of target point -> m () drawLineTo :: forall (m :: * -> *). (HasCallStack, MonadIO m) => DrawFuncsT -> Ptr () -> DrawStateT -> Float -> Float -> m () drawLineTo DrawFuncsT dfuncs Ptr () drawData DrawStateT st Float toX Float toY = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr DrawFuncsT dfuncs st' <- unsafeManagedPtrGetPtr st let toX' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float toX let toY' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float toY hb_draw_line_to dfuncs' drawData st' toX' toY' touchManagedPtr dfuncs touchManagedPtr st return () -- function draw_funcs_set_quadratic_to_func -- XXX Could not generate function draw_funcs_set_quadratic_to_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function draw_funcs_set_move_to_func -- XXX Could not generate function draw_funcs_set_move_to_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function draw_funcs_set_line_to_func -- XXX Could not generate function draw_funcs_set_line_to_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function draw_funcs_set_cubic_to_func -- XXX Could not generate function draw_funcs_set_cubic_to_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function draw_funcs_set_close_path_func -- XXX Could not generate function draw_funcs_set_close_path_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function draw_funcs_make_immutable -- Args: [ Arg -- { argCName = "dfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" } -- , argCType = Just "hb_draw_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "draw functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_draw_funcs_make_immutable" hb_draw_funcs_make_immutable :: Ptr HarfBuzz.DrawFuncsT.DrawFuncsT -> -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"}) IO () -- | Makes /@dfuncs@/ object immutable. -- -- /Since: 4.0.0/ drawFuncsMakeImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ /@dfuncs@/: draw functions -> m () drawFuncsMakeImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => DrawFuncsT -> m () drawFuncsMakeImmutable DrawFuncsT dfuncs = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr DrawFuncsT dfuncs hb_draw_funcs_make_immutable dfuncs' touchManagedPtr dfuncs return () -- function draw_funcs_is_immutable -- Args: [ Arg -- { argCName = "dfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" } -- , argCType = Just "hb_draw_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "draw functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_draw_funcs_is_immutable" hb_draw_funcs_is_immutable :: Ptr HarfBuzz.DrawFuncsT.DrawFuncsT -> -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"}) IO Int32 -- | Checks whether /@dfuncs@/ is immutable. -- -- /Since: 4.0.0/ drawFuncsIsImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ /@dfuncs@/: draw functions -> m Int32 -- ^ __Returns:__ @true@ if /@dfuncs@/ is immutable, @false@ otherwise drawFuncsIsImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => DrawFuncsT -> m Int32 drawFuncsIsImmutable DrawFuncsT dfuncs = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr DrawFuncsT dfuncs result <- hb_draw_funcs_is_immutable dfuncs' touchManagedPtr dfuncs return result -- function draw_funcs_get_empty -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "draw_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_draw_funcs_get_empty" hb_draw_funcs_get_empty :: IO (Ptr HarfBuzz.DrawFuncsT.DrawFuncsT) -- | Fetches the singleton empty draw-functions structure. -- -- /Since: 7.0.0/ drawFuncsGetEmpty :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ __Returns:__ The empty draw-functions structure drawFuncsGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m DrawFuncsT drawFuncsGetEmpty = IO DrawFuncsT -> m DrawFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO DrawFuncsT -> m DrawFuncsT) -> IO DrawFuncsT -> m DrawFuncsT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr DrawFuncsT) hb_draw_funcs_get_empty checkUnexpectedReturnNULL "drawFuncsGetEmpty" result result' <- (wrapBoxed HarfBuzz.DrawFuncsT.DrawFuncsT) result return result' -- function draw_funcs_create -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "draw_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_draw_funcs_create" hb_draw_funcs_create :: IO (Ptr HarfBuzz.DrawFuncsT.DrawFuncsT) -- | Creates a new draw callbacks object. -- -- /Since: 4.0.0/ drawFuncsCreate :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ __Returns:__ -- A newly allocated t'GI.HarfBuzz.Structs.DrawFuncsT.DrawFuncsT' with a reference count of 1. The initial -- reference count should be released with hb_draw_funcs_destroy when you are -- done using the t'GI.HarfBuzz.Structs.DrawFuncsT.DrawFuncsT'. This function never returns @NULL@. If -- memory cannot be allocated, a special singleton t'GI.HarfBuzz.Structs.DrawFuncsT.DrawFuncsT' object will -- be returned. drawFuncsCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m DrawFuncsT drawFuncsCreate = IO DrawFuncsT -> m DrawFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO DrawFuncsT -> m DrawFuncsT) -> IO DrawFuncsT -> m DrawFuncsT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr DrawFuncsT) hb_draw_funcs_create checkUnexpectedReturnNULL "drawFuncsCreate" result result' <- (wrapBoxed HarfBuzz.DrawFuncsT.DrawFuncsT) result return result' -- function draw_cubic_to -- Args: [ Arg -- { argCName = "dfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" } -- , argCType = Just "hb_draw_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "draw functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "draw_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated draw data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "st" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_state_t" } -- , argCType = Just "hb_draw_state_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "current draw state" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "control1_x" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X component of first control point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "control1_y" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y component of first control point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "control2_x" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X component of second control point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "control2_y" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y component of second control point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "to_x" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "X component of target point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "to_y" -- , argType = TBasicType TFloat -- , argCType = Just "float" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Y component of target point" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_draw_cubic_to" hb_draw_cubic_to :: Ptr HarfBuzz.DrawFuncsT.DrawFuncsT -> -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"}) Ptr () -> -- draw_data : TBasicType TPtr Ptr HarfBuzz.DrawStateT.DrawStateT -> -- st : TInterface (Name {namespace = "HarfBuzz", name = "draw_state_t"}) CFloat -> -- control1_x : TBasicType TFloat CFloat -> -- control1_y : TBasicType TFloat CFloat -> -- control2_x : TBasicType TFloat CFloat -> -- control2_y : TBasicType TFloat CFloat -> -- to_x : TBasicType TFloat CFloat -> -- to_y : TBasicType TFloat IO () -- | Perform a \"cubic-to\" draw operation. -- -- /Since: 4.0.0/ drawCubicTo :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ /@dfuncs@/: draw functions -> Ptr () -- ^ /@drawData@/: associated draw data passed by the caller -> HarfBuzz.DrawStateT.DrawStateT -- ^ /@st@/: current draw state -> Float -- ^ /@control1X@/: X component of first control point -> Float -- ^ /@control1Y@/: Y component of first control point -> Float -- ^ /@control2X@/: X component of second control point -> Float -- ^ /@control2Y@/: Y component of second control point -> Float -- ^ /@toX@/: X component of target point -> Float -- ^ /@toY@/: Y component of target point -> m () drawCubicTo :: forall (m :: * -> *). (HasCallStack, MonadIO m) => DrawFuncsT -> Ptr () -> DrawStateT -> Float -> Float -> Float -> Float -> Float -> Float -> m () drawCubicTo DrawFuncsT dfuncs Ptr () drawData DrawStateT st Float control1X Float control1Y Float control2X Float control2Y Float toX Float toY = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr DrawFuncsT dfuncs st' <- unsafeManagedPtrGetPtr st let control1X' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float control1X let control1Y' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float control1Y let control2X' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float control2X let control2Y' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float control2Y let toX' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float toX let toY' = Float -> CFloat forall a b. (Real a, Fractional b) => a -> b realToFrac Float toY hb_draw_cubic_to dfuncs' drawData st' control1X' control1Y' control2X' control2Y' toX' toY' touchManagedPtr dfuncs touchManagedPtr st return () -- function draw_close_path -- Args: [ Arg -- { argCName = "dfuncs" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" } -- , argCType = Just "hb_draw_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "draw functions" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "draw_data" -- , argType = TBasicType TPtr -- , argCType = Just "void*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "associated draw data passed by the caller" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "st" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "draw_state_t" } -- , argCType = Just "hb_draw_state_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "current draw state" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_draw_close_path" hb_draw_close_path :: Ptr HarfBuzz.DrawFuncsT.DrawFuncsT -> -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"}) Ptr () -> -- draw_data : TBasicType TPtr Ptr HarfBuzz.DrawStateT.DrawStateT -> -- st : TInterface (Name {namespace = "HarfBuzz", name = "draw_state_t"}) IO () -- | Perform a \"close-path\" draw operation. -- -- /Since: 4.0.0/ drawClosePath :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.DrawFuncsT.DrawFuncsT -- ^ /@dfuncs@/: draw functions -> Ptr () -- ^ /@drawData@/: associated draw data passed by the caller -> HarfBuzz.DrawStateT.DrawStateT -- ^ /@st@/: current draw state -> m () drawClosePath :: forall (m :: * -> *). (HasCallStack, MonadIO m) => DrawFuncsT -> Ptr () -> DrawStateT -> m () drawClosePath DrawFuncsT dfuncs Ptr () drawData DrawStateT st = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr DrawFuncsT dfuncs st' <- unsafeManagedPtrGetPtr st hb_draw_close_path dfuncs' drawData st' touchManagedPtr dfuncs touchManagedPtr st return () -- function direction_to_string -- Args: [ Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The #hb_direction_t to convert" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "hb_direction_to_string" hb_direction_to_string :: CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) IO CString -- | Converts an t'GI.HarfBuzz.Enums.DirectionT' to a string. -- -- /Since: 0.9.2/ directionToString :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.Enums.DirectionT -- ^ /@direction@/: The t'GI.HarfBuzz.Enums.DirectionT' to convert -> m T.Text -- ^ __Returns:__ The string corresponding to /@direction@/ directionToString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => DirectionT -> m Text directionToString DirectionT direction = IO Text -> m Text forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Text -> m Text) -> IO Text -> m Text forall a b. (a -> b) -> a -> b $ do let direction' :: CUInt direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction result <- CUInt -> IO (Ptr CChar) hb_direction_to_string CUInt direction' checkUnexpectedReturnNULL "directionToString" result result' <- cstringToText result return result' -- function direction_from_string -- Args: [ Arg -- { argCName = "str" -- , argType = TCArray False (-1) 1 (TBasicType TUInt8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "String to convert" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Length of @str, or -1 if it is `NULL`-terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Length of @str, or -1 if it is `NULL`-terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_direction_from_string" hb_direction_from_string :: Ptr Word8 -> -- str : TCArray False (-1) 1 (TBasicType TUInt8) Int32 -> -- len : TBasicType TInt IO CUInt -- | Converts a string to an t'GI.HarfBuzz.Enums.DirectionT'. -- -- Matching is loose and applies only to the first letter. For -- examples, \"LTR\" and \"left-to-right\" will both return @/HB_DIRECTION_LTR/@. -- -- Unmatched strings will return @/HB_DIRECTION_INVALID/@. -- -- /Since: 0.9.2/ directionFromString :: (B.CallStack.HasCallStack, MonadIO m) => ByteString -- ^ /@str@/: String to convert -> m HarfBuzz.Enums.DirectionT -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.DirectionT' matching /@str@/ directionFromString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ByteString -> m DirectionT directionFromString ByteString str = IO DirectionT -> m DirectionT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO DirectionT -> m DirectionT) -> IO DirectionT -> m DirectionT forall a b. (a -> b) -> a -> b $ do let len :: Int32 len = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString str str' <- ByteString -> IO (Ptr Word8) packByteString ByteString str result <- hb_direction_from_string str' len let result' = (Int -> DirectionT forall a. Enum a => Int -> a toEnum (Int -> DirectionT) -> (CUInt -> Int) -> CUInt -> DirectionT forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result freeMem str' return result' -- function color_line_get_extend -- Args: [ Arg -- { argCName = "color_line" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "color_line_t" } -- , argCType = Just "hb_color_line_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #hb_color_line_t object" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "paint_extend_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_color_line_get_extend" hb_color_line_get_extend :: Ptr HarfBuzz.ColorLineT.ColorLineT -> -- color_line : TInterface (Name {namespace = "HarfBuzz", name = "color_line_t"}) IO CUInt -- | Fetches the extend mode of the color line object. -- -- /Since: 7.0.0/ colorLineGetExtend :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.ColorLineT.ColorLineT -- ^ /@colorLine@/: a t'GI.HarfBuzz.Structs.ColorLineT.ColorLineT' object -> m HarfBuzz.Enums.PaintExtendT -- ^ __Returns:__ the extend mode of /@colorLine@/ colorLineGetExtend :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ColorLineT -> m PaintExtendT colorLineGetExtend ColorLineT colorLine = IO PaintExtendT -> m PaintExtendT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO PaintExtendT -> m PaintExtendT) -> IO PaintExtendT -> m PaintExtendT forall a b. (a -> b) -> a -> b $ do colorLine' <- ColorLineT -> IO (Ptr ColorLineT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr ColorLineT colorLine result <- hb_color_line_get_extend colorLine' let result' = (Int -> PaintExtendT forall a. Enum a => Int -> a toEnum (Int -> PaintExtendT) -> (CUInt -> Int) -> CUInt -> PaintExtendT forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result touchManagedPtr colorLine return result' -- function color_line_get_color_stops -- Args: [ Arg -- { argCName = "color_line" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "color_line_t" } -- , argCType = Just "hb_color_line_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #hb_color_line_t object" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the index of the first color stop to return" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of feature tags to return;\n Output = the actual number of feature tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "color_stops" -- , argType = -- TCArray -- False -- (-1) -- 2 -- (TInterface -- Name { namespace = "HarfBuzz" , name = "color_stop_t" }) -- , argCType = Just "hb_color_stop_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Array of #hb_color_stop_t to populate" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of feature tags to return;\n Output = the actual number of feature tags returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_color_line_get_color_stops" hb_color_line_get_color_stops :: Ptr HarfBuzz.ColorLineT.ColorLineT -> -- color_line : TInterface (Name {namespace = "HarfBuzz", name = "color_line_t"}) Word32 -> -- start : TBasicType TUInt Word32 -> -- count : TBasicType TUInt Ptr HarfBuzz.ColorStopT.ColorStopT -> -- color_stops : TCArray False (-1) 2 (TInterface (Name {namespace = "HarfBuzz", name = "color_stop_t"})) IO Word32 -- | Fetches a list of color stops from the given color line object. -- -- Note that due to variations being applied, the returned color stops -- may be out of order. It is the callers responsibility to ensure that -- color stops are sorted by their offset before they are used. -- -- /Since: 7.0.0/ colorLineGetColorStops :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.ColorLineT.ColorLineT -- ^ /@colorLine@/: a t'GI.HarfBuzz.Structs.ColorLineT.ColorLineT' object -> Word32 -- ^ /@start@/: the index of the first color stop to return -> [HarfBuzz.ColorStopT.ColorStopT] -- ^ /@colorStops@/: Array of t'GI.HarfBuzz.Structs.ColorStopT.ColorStopT' to populate -> m ((Word32, [HarfBuzz.ColorStopT.ColorStopT])) -- ^ __Returns:__ the total number of color stops in /@colorLine@/ colorLineGetColorStops :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ColorLineT -> Word32 -> [ColorStopT] -> m (Word32, [ColorStopT]) colorLineGetColorStops ColorLineT colorLine Word32 start [ColorStopT] colorStops = IO (Word32, [ColorStopT]) -> m (Word32, [ColorStopT]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [ColorStopT]) -> m (Word32, [ColorStopT])) -> IO (Word32, [ColorStopT]) -> m (Word32, [ColorStopT]) forall a b. (a -> b) -> a -> b $ do let count :: Word32 count = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [ColorStopT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [ColorStopT] colorStops colorLine' <- ColorLineT -> IO (Ptr ColorLineT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr ColorLineT colorLine colorStops' <- mapM B.ManagedPtr.disownBoxed colorStops colorStops'' <- packBlockArray 12 colorStops' result <- hb_color_line_get_color_stops colorLine' start count colorStops'' colorStops''' <- (unpackBoxedArrayWithLength 12 count) colorStops'' colorStops'''' <- mapM (wrapBoxed HarfBuzz.ColorStopT.ColorStopT) colorStops''' freeMem colorStops'' touchManagedPtr colorLine mapM_ touchManagedPtr colorStops return (result, colorStops'''') -- function color_get_red -- Args: [ Arg -- { argCName = "color" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_color_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "an #hb_color_t we are interested in its channels." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt8) -- throws : False -- Skip return : False foreign import ccall "hb_color_get_red" hb_color_get_red :: Word32 -> -- color : TBasicType TUInt32 IO Word8 -- | Fetches the red channel of the given /@color@/. -- -- /Since: 2.1.0/ colorGetRed :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@color@/: an @/hb_color_t/@ we are interested in its channels. -> m Word8 -- ^ __Returns:__ Red channel value colorGetRed :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> m Word8 colorGetRed Word32 color = IO Word8 -> m Word8 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8 forall a b. (a -> b) -> a -> b $ do result <- Word32 -> IO Word8 hb_color_get_red Word32 color return result -- function color_get_green -- Args: [ Arg -- { argCName = "color" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_color_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "an #hb_color_t we are interested in its channels." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt8) -- throws : False -- Skip return : False foreign import ccall "hb_color_get_green" hb_color_get_green :: Word32 -> -- color : TBasicType TUInt32 IO Word8 -- | Fetches the green channel of the given /@color@/. -- -- /Since: 2.1.0/ colorGetGreen :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@color@/: an @/hb_color_t/@ we are interested in its channels. -> m Word8 -- ^ __Returns:__ Green channel value colorGetGreen :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> m Word8 colorGetGreen Word32 color = IO Word8 -> m Word8 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8 forall a b. (a -> b) -> a -> b $ do result <- Word32 -> IO Word8 hb_color_get_green Word32 color return result -- function color_get_blue -- Args: [ Arg -- { argCName = "color" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_color_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "an #hb_color_t we are interested in its channels." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt8) -- throws : False -- Skip return : False foreign import ccall "hb_color_get_blue" hb_color_get_blue :: Word32 -> -- color : TBasicType TUInt32 IO Word8 -- | Fetches the blue channel of the given /@color@/. -- -- /Since: 2.1.0/ colorGetBlue :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@color@/: an @/hb_color_t/@ we are interested in its channels. -> m Word8 -- ^ __Returns:__ Blue channel value colorGetBlue :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> m Word8 colorGetBlue Word32 color = IO Word8 -> m Word8 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8 forall a b. (a -> b) -> a -> b $ do result <- Word32 -> IO Word8 hb_color_get_blue Word32 color return result -- function color_get_alpha -- Args: [ Arg -- { argCName = "color" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_color_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "an #hb_color_t we are interested in its channels." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt8) -- throws : False -- Skip return : False foreign import ccall "hb_color_get_alpha" hb_color_get_alpha :: Word32 -> -- color : TBasicType TUInt32 IO Word8 -- | Fetches the alpha channel of the given /@color@/. -- -- /Since: 2.1.0/ colorGetAlpha :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@color@/: an @/hb_color_t/@ we are interested in its channels. -> m Word8 -- ^ __Returns:__ Alpha channel value colorGetAlpha :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> m Word8 colorGetAlpha Word32 color = IO Word8 -> m Word8 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8 forall a b. (a -> b) -> a -> b $ do result <- Word32 -> IO Word8 hb_color_get_alpha Word32 color return result -- function calloc -- Args: [ Arg -- { argCName = "nmemb" -- , argType = TBasicType TSize -- , argCType = Just "size_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The number of elements to allocate." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "size" -- , argType = TBasicType TSize -- , argCType = Just "size_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The size of each element." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TPtr) -- throws : False -- Skip return : False foreign import ccall "hb_calloc" hb_calloc :: FCT.CSize -> -- nmemb : TBasicType TSize FCT.CSize -> -- size : TBasicType TSize IO (Ptr ()) -- | Allocates /@nmemb@/ elements of /@size@/ bytes each, initialized to zero, -- using the allocator set at compile-time. Typically just @/calloc()/@. -- -- /Since: 11.0.0/ calloc :: (B.CallStack.HasCallStack, MonadIO m) => FCT.CSize -- ^ /@nmemb@/: The number of elements to allocate. -> FCT.CSize -- ^ /@size@/: The size of each element. -> m (Ptr ()) -- ^ __Returns:__ A pointer to the allocated memory. calloc :: forall (m :: * -> *). (HasCallStack, MonadIO m) => CSize -> CSize -> m (Ptr ()) calloc CSize nmemb CSize size = IO (Ptr ()) -> m (Ptr ()) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ()) forall a b. (a -> b) -> a -> b $ do result <- CSize -> CSize -> IO (Ptr ()) hb_calloc CSize nmemb CSize size return result -- function buffer_set_unicode_funcs -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "unicode_funcs" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" } -- , argCType = Just "hb_unicode_funcs_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The Unicode-functions structure" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_unicode_funcs" hb_buffer_set_unicode_funcs :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- unicode_funcs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"}) IO () -- | Sets the Unicode-functions structure of a buffer to -- /@unicodeFuncs@/. -- -- /Since: 0.9.2/ bufferSetUnicodeFuncs :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ /@unicodeFuncs@/: The Unicode-functions structure -> m () bufferSetUnicodeFuncs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> UnicodeFuncsT -> m () bufferSetUnicodeFuncs BufferT buffer UnicodeFuncsT unicodeFuncs = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer unicodeFuncs' <- unsafeManagedPtrGetPtr unicodeFuncs hb_buffer_set_unicode_funcs buffer' unicodeFuncs' touchManagedPtr buffer touchManagedPtr unicodeFuncs return () -- function buffer_set_segment_properties -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "props" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "segment_properties_t" } -- , argCType = Just "const hb_segment_properties_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_segment_properties_t to use" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_segment_properties" hb_buffer_set_segment_properties :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"}) IO () -- | Sets the segment properties of the buffer, a shortcut for calling -- 'GI.HarfBuzz.Functions.bufferSetDirection', 'GI.HarfBuzz.Functions.bufferSetScript' and -- 'GI.HarfBuzz.Functions.bufferSetLanguage' individually. -- -- /Since: 0.9.7/ bufferSetSegmentProperties :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -- ^ /@props@/: An t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to use -> m () bufferSetSegmentProperties :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> SegmentPropertiesT -> m () bufferSetSegmentProperties BufferT buffer SegmentPropertiesT props = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer props' <- unsafeManagedPtrGetPtr props hb_buffer_set_segment_properties buffer' props' touchManagedPtr buffer touchManagedPtr props return () -- function buffer_set_script -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "script" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "script_t" } -- , argCType = Just "hb_script_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_script_t to set." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_script" hb_buffer_set_script :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) CUInt -> -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"}) IO () -- | Sets the script of /@buffer@/ to /@script@/. -- -- Script is crucial for choosing the proper shaping behaviour for scripts that -- require it (e.g. Arabic) and the which OpenType features defined in the font -- to be applied. -- -- You can pass one of the predefined t'GI.HarfBuzz.Flags.ScriptT' values, or use -- 'GI.HarfBuzz.Functions.scriptFromString' or 'GI.HarfBuzz.Functions.scriptFromIso15924Tag' to get the -- corresponding script from an ISO 15924 script tag. -- -- /Since: 0.9.2/ bufferSetScript :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> [HarfBuzz.Flags.ScriptT] -- ^ /@script@/: An t'GI.HarfBuzz.Flags.ScriptT' to set. -> m () bufferSetScript :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> [ScriptT] -> m () bufferSetScript BufferT buffer [ScriptT] script = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer let script' = [ScriptT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ScriptT] script hb_buffer_set_script buffer' script' touchManagedPtr buffer return () -- function buffer_set_replacement_codepoint -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "replacement" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the replacement #hb_codepoint_t" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_replacement_codepoint" hb_buffer_set_replacement_codepoint :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- replacement : TBasicType TUInt32 IO () -- | Sets the @/hb_codepoint_t/@ that replaces invalid entries for a given encoding -- when adding text to /@buffer@/. -- -- Default is 'GI.HarfBuzz.Constants.BUFFER_REPLACEMENT_CODEPOINT_DEFAULT'. -- -- /Since: 0.9.31/ bufferSetReplacementCodepoint :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> Word32 -- ^ /@replacement@/: the replacement @/hb_codepoint_t/@ -> m () bufferSetReplacementCodepoint :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> m () bufferSetReplacementCodepoint BufferT buffer Word32 replacement = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_set_replacement_codepoint buffer' replacement touchManagedPtr buffer return () -- function buffer_set_random_state -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "state" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the new random state" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_random_state" hb_buffer_set_random_state :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- state : TBasicType TUInt IO () -- | Sets the random state of the buffer. The state changes -- every time a glyph uses randomness (eg. the @rand@ -- OpenType feature). This function together with -- 'GI.HarfBuzz.Functions.bufferGetRandomState' allow for transferring -- the current random state to a subsequent buffer, to -- get better randomness distribution. -- -- Defaults to 1 and when buffer contents are cleared. -- A value of 0 disables randomness during shaping. -- -- /Since: 8.4.0/ bufferSetRandomState :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> Word32 -- ^ /@state@/: the new random state -> m () bufferSetRandomState :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> m () bufferSetRandomState BufferT buffer Word32 state = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_set_random_state buffer' state touchManagedPtr buffer return () -- function buffer_set_not_found_variation_selector_glyph -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "not_found_variation_selector" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the not-found-variation-selector #hb_codepoint_t" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_not_found_variation_selector_glyph" hb_buffer_set_not_found_variation_selector_glyph :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- not_found_variation_selector : TBasicType TUInt32 IO () -- | Sets the @/hb_codepoint_t/@ that replaces variation-selector characters not resolved -- in the font during shaping. -- -- The not-found-variation-selector glyph defaults to 'GI.HarfBuzz.Constants.CODEPOINT_INVALID', -- in which case an unresolved variation-selector will be removed from the glyph -- string during shaping. This API allows for changing that and retaining a glyph, -- such that the situation can be detected by the client and handled accordingly -- (e.g. by using a different font). -- -- /Since: 10.0.0/ bufferSetNotFoundVariationSelectorGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> Word32 -- ^ /@notFoundVariationSelector@/: the not-found-variation-selector @/hb_codepoint_t/@ -> m () bufferSetNotFoundVariationSelectorGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> m () bufferSetNotFoundVariationSelectorGlyph BufferT buffer Word32 notFoundVariationSelector = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_set_not_found_variation_selector_glyph buffer' notFoundVariationSelector touchManagedPtr buffer return () -- function buffer_set_not_found_glyph -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "not_found" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the not-found #hb_codepoint_t" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_not_found_glyph" hb_buffer_set_not_found_glyph :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- not_found : TBasicType TUInt32 IO () -- | Sets the @/hb_codepoint_t/@ that replaces characters not found in -- the font during shaping. -- -- The not-found glyph defaults to zero, sometimes known as the -- \".notdef\" glyph. This API allows for differentiating the two. -- -- /Since: 3.1.0/ bufferSetNotFoundGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> Word32 -- ^ /@notFound@/: the not-found @/hb_codepoint_t/@ -> m () bufferSetNotFoundGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> m () bufferSetNotFoundGlyph BufferT buffer Word32 notFound = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_set_not_found_glyph buffer' notFound touchManagedPtr buffer return () -- function buffer_set_message_func -- XXX Could not generate function buffer_set_message_func -- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"}) -- function buffer_set_length -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The new length of @buffer" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_length" hb_buffer_set_length :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- length : TBasicType TUInt IO Int32 -- | Similar to 'GI.HarfBuzz.Functions.bufferPreAllocate', but clears any new items added at the -- end. -- -- /Since: 0.9.2/ bufferSetLength :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> Word32 -- ^ /@length@/: The new length of /@buffer@/ -> m Int32 -- ^ __Returns:__ @true@ if /@buffer@/ memory allocation succeeded, @false@ otherwise. bufferSetLength :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> m Int32 bufferSetLength BufferT buffer Word32 length_ = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_set_length buffer' length_ touchManagedPtr buffer return result -- function buffer_set_language -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "language" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "language_t" } -- , argCType = Just "hb_language_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An hb_language_t to set" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_language" hb_buffer_set_language :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr HarfBuzz.LanguageT.LanguageT -> -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"}) IO () -- | Sets the language of /@buffer@/ to /@language@/. -- -- Languages are crucial for selecting which OpenType feature to apply to the -- buffer which can result in applying language-specific behaviour. Languages -- are orthogonal to the scripts, and though they are related, they are -- different concepts and should not be confused with each other. -- -- Use 'GI.HarfBuzz.Functions.languageFromString' to convert from BCP 47 language tags to -- t'GI.HarfBuzz.Structs.LanguageT.LanguageT'. -- -- /Since: 0.9.2/ bufferSetLanguage :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> HarfBuzz.LanguageT.LanguageT -- ^ /@language@/: An hb_language_t to set -> m () bufferSetLanguage :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> LanguageT -> m () bufferSetLanguage BufferT buffer LanguageT language = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer language' <- unsafeManagedPtrGetPtr language hb_buffer_set_language buffer' language' touchManagedPtr buffer touchManagedPtr language return () -- function buffer_set_invisible_glyph -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "invisible" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the invisible #hb_codepoint_t" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_invisible_glyph" hb_buffer_set_invisible_glyph :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- invisible : TBasicType TUInt32 IO () -- | Sets the @/hb_codepoint_t/@ that replaces invisible characters in -- the shaping result. If set to zero (default), the glyph for the -- U+0020 SPACE character is used. Otherwise, this value is used -- verbatim. -- -- /Since: 2.0.0/ bufferSetInvisibleGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> Word32 -- ^ /@invisible@/: the invisible @/hb_codepoint_t/@ -> m () bufferSetInvisibleGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> m () bufferSetInvisibleGlyph BufferT buffer Word32 invisible = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_set_invisible_glyph buffer' invisible touchManagedPtr buffer return () -- function buffer_set_flags -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "buffer_flags_t" } -- , argCType = Just "hb_buffer_flags_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The buffer flags to set" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_flags" hb_buffer_set_flags :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) CUInt -> -- flags : TInterface (Name {namespace = "HarfBuzz", name = "buffer_flags_t"}) IO () -- | Sets /@buffer@/ flags to /@flags@/. See t'GI.HarfBuzz.Flags.BufferFlagsT'. -- -- /Since: 0.9.7/ bufferSetFlags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> [HarfBuzz.Flags.BufferFlagsT] -- ^ /@flags@/: The buffer flags to set -> m () bufferSetFlags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> [BufferFlagsT] -> m () bufferSetFlags BufferT buffer [BufferFlagsT] flags = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer let flags' = [BufferFlagsT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BufferFlagsT] flags hb_buffer_set_flags buffer' flags' touchManagedPtr buffer return () -- function buffer_set_direction -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "direction" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "direction_t" } -- , argCType = Just "hb_direction_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the #hb_direction_t of the @buffer" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_direction" hb_buffer_set_direction :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) CUInt -> -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"}) IO () -- | Set the text flow direction of the buffer. No shaping can happen without -- setting /@buffer@/ direction, and it controls the visual direction for the -- output glyphs; for RTL direction the glyphs will be reversed. Many layout -- features depend on the proper setting of the direction, for example, -- reversing RTL text before shaping, then shaping with LTR direction is not -- the same as keeping the text in logical order and shaping with RTL -- direction. -- -- /Since: 0.9.2/ bufferSetDirection :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> HarfBuzz.Enums.DirectionT -- ^ /@direction@/: the t'GI.HarfBuzz.Enums.DirectionT' of the /@buffer@/ -> m () bufferSetDirection :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> DirectionT -> m () bufferSetDirection BufferT buffer DirectionT direction = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer let direction' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . DirectionT -> Int forall a. Enum a => a -> Int fromEnum) DirectionT direction hb_buffer_set_direction buffer' direction' touchManagedPtr buffer return () -- function buffer_set_content_type -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "content_type" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "buffer_content_type_t" } -- , argCType = Just "hb_buffer_content_type_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The type of buffer contents to set" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_content_type" hb_buffer_set_content_type :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) CUInt -> -- content_type : TInterface (Name {namespace = "HarfBuzz", name = "buffer_content_type_t"}) IO () -- | Sets the type of /@buffer@/ contents. Buffers are either empty, contain -- characters (before shaping), or contain glyphs (the result of shaping). -- -- You rarely need to call this function, since a number of other -- functions transition the content type for you. Namely: -- -- * A newly created buffer starts with content type -- 'GI.HarfBuzz.Enums.BufferContentTypeTInvalid'. Calling 'GI.HarfBuzz.Functions.bufferReset', -- 'GI.HarfBuzz.Functions.bufferClearContents', as well as calling 'GI.HarfBuzz.Functions.bufferSetLength' -- with an argument of zero all set the buffer content type to invalid -- as well. -- * Calling 'GI.HarfBuzz.Functions.bufferAddUtf8', 'GI.HarfBuzz.Functions.bufferAddUtf16', -- 'GI.HarfBuzz.Functions.bufferAddUtf32', 'GI.HarfBuzz.Functions.bufferAddCodepoints' and -- 'GI.HarfBuzz.Functions.bufferAddLatin1' expect that buffer is either empty and -- have a content type of invalid, or that buffer content type is -- 'GI.HarfBuzz.Enums.BufferContentTypeTUnicode', and they also set the content -- type to Unicode if they added anything to an empty buffer. -- * Finally 'GI.HarfBuzz.Functions.shape' and 'GI.HarfBuzz.Functions.shapeFull' expect that the buffer -- is either empty and have content type of invalid, or that buffer -- content type is 'GI.HarfBuzz.Enums.BufferContentTypeTUnicode', and upon -- success they set the buffer content type to -- 'GI.HarfBuzz.Enums.BufferContentTypeTGlyphs'. -- -- -- The above transitions are designed such that one can use a buffer -- in a loop of \"reset : add-text : shape\" without needing to ever -- modify the content type manually. -- -- /Since: 0.9.5/ bufferSetContentType :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> HarfBuzz.Enums.BufferContentTypeT -- ^ /@contentType@/: The type of buffer contents to set -> m () bufferSetContentType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> BufferContentTypeT -> m () bufferSetContentType BufferT buffer BufferContentTypeT contentType = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer let contentType' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (BufferContentTypeT -> Int) -> BufferContentTypeT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . BufferContentTypeT -> Int forall a. Enum a => a -> Int fromEnum) BufferContentTypeT contentType hb_buffer_set_content_type buffer' contentType' touchManagedPtr buffer return () -- function buffer_set_cluster_level -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cluster_level" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "buffer_cluster_level_t" } -- , argCType = Just "hb_buffer_cluster_level_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The cluster level to set on the buffer" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_set_cluster_level" hb_buffer_set_cluster_level :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) CUInt -> -- cluster_level : TInterface (Name {namespace = "HarfBuzz", name = "buffer_cluster_level_t"}) IO () -- | Sets the cluster level of a buffer. The t'GI.HarfBuzz.Enums.BufferClusterLevelT' -- dictates one aspect of how HarfBuzz will treat non-base characters -- during shaping. -- -- /Since: 0.9.42/ bufferSetClusterLevel :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> HarfBuzz.Enums.BufferClusterLevelT -- ^ /@clusterLevel@/: The cluster level to set on the buffer -> m () bufferSetClusterLevel :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> BufferClusterLevelT -> m () bufferSetClusterLevel BufferT buffer BufferClusterLevelT clusterLevel = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer let clusterLevel' = (Int -> CUInt forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> CUInt) -> (BufferClusterLevelT -> Int) -> BufferClusterLevelT -> CUInt forall b c a. (b -> c) -> (a -> b) -> a -> c . BufferClusterLevelT -> Int forall a. Enum a => a -> Int fromEnum) BufferClusterLevelT clusterLevel hb_buffer_set_cluster_level buffer' clusterLevel' touchManagedPtr buffer return () -- function buffer_serialize_unicode -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_buffer_t buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the first item in @buffer to serialize." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "end" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the last item in @buffer to serialize." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buf" -- , argType = TCArray False (-1) 4 (TBasicType TUInt8) -- , argCType = Just "char*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "output string to\n write serialized buffer into." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "buf_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the size of @buf." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "buf_consumed" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "if not `NULL`, will be set to the number of bytes written into @buf." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "format" -- , argType = -- TInterface -- Name -- { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" } -- , argCType = Just "hb_buffer_serialize_format_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the #hb_buffer_serialize_format_t to use for formatting the output." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "buffer_serialize_flags_t" } -- , argCType = Just "hb_buffer_serialize_flags_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the #hb_buffer_serialize_flags_t that control what glyph properties\n to serialize." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "buf_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the size of @buf." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_serialize_unicode" hb_buffer_serialize_unicode :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- start : TBasicType TUInt Word32 -> -- end : TBasicType TUInt Ptr (Ptr Word8) -> -- buf : TCArray False (-1) 4 (TBasicType TUInt8) Ptr Word32 -> -- buf_size : TBasicType TUInt Ptr Word32 -> -- buf_consumed : TBasicType TUInt CUInt -> -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"}) CUInt -> -- flags : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_flags_t"}) IO Word32 -- | Serializes /@buffer@/ into a textual representation of its content, -- when the buffer contains Unicode codepoints (i.e., before shaping). This is -- useful for showing the contents of the buffer, for example during debugging. -- There are currently two supported serialization formats: -- -- == text -- A human-readable, plain text format. -- The serialized codepoints will look something like: -- -- -- -- > <U+0651=0|U+0628=1> -- -- -- * Glyphs are separated with @|@ -- * Unicode codepoints are expressed as zero-padded four (or more) -- digit hexadecimal numbers preceded by @U+@ -- * If @/HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS/@ is not set, the cluster -- will be indicated with a @=@ then t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'.@/cluster/@. -- -- -- == json -- A machine-readable, structured format. -- The serialized codepoints will be a list of objects with the following -- properties: -- * @u@: the Unicode codepoint as a decimal integer -- * @cl@: t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'.@/cluster/@ if -- @/HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS/@ is not set. -- -- -- For example: -- -- -- -- >[{u:1617,cl:0},{u:1576,cl:1}] -- -- -- /Since: 2.7.3/ bufferSerializeUnicode :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' buffer. -> Word32 -- ^ /@start@/: the first item in /@buffer@/ to serialize. -> Word32 -- ^ /@end@/: the last item in /@buffer@/ to serialize. -> [HarfBuzz.Flags.BufferSerializeFormatT] -- ^ /@format@/: the t'GI.HarfBuzz.Flags.BufferSerializeFormatT' to use for formatting the output. -> [HarfBuzz.Flags.BufferSerializeFlagsT] -- ^ /@flags@/: the t'GI.HarfBuzz.Flags.BufferSerializeFlagsT' that control what glyph properties -- to serialize. -> m ((Word32, ByteString, Word32)) -- ^ __Returns:__ The number of serialized items. bufferSerializeUnicode :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> Word32 -> [BufferSerializeFormatT] -> [BufferSerializeFlagsT] -> m (Word32, ByteString, Word32) bufferSerializeUnicode BufferT buffer Word32 start Word32 end [BufferSerializeFormatT] format [BufferSerializeFlagsT] flags = IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32)) -> IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32) forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer buf <- callocMem :: IO (Ptr (Ptr Word8)) bufSize <- allocMem :: IO (Ptr Word32) bufConsumed <- allocMem :: IO (Ptr Word32) let format' = [BufferSerializeFormatT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BufferSerializeFormatT] format let flags' = [BufferSerializeFlagsT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BufferSerializeFlagsT] flags result <- hb_buffer_serialize_unicode buffer' start end buf bufSize bufConsumed format' flags' bufSize' <- peek bufSize buf' <- peek buf buf'' <- (unpackByteStringWithLength bufSize') buf' freeMem buf' bufConsumed' <- peek bufConsumed touchManagedPtr buffer freeMem buf freeMem bufSize freeMem bufConsumed return (result, buf'', bufConsumed') -- function buffer_serialize_list_formats -- Args: [] -- Lengths: [] -- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_serialize_list_formats" hb_buffer_serialize_list_formats :: IO (Ptr CString) -- | Returns a list of supported buffer serialization formats. -- -- /Since: 0.9.7/ bufferSerializeListFormats :: (B.CallStack.HasCallStack, MonadIO m) => m [T.Text] -- ^ __Returns:__ -- A string array of buffer serialization formats. Should not be freed. bufferSerializeListFormats :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [Text] bufferSerializeListFormats = IO [Text] -> m [Text] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text] forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr (Ptr CChar)) hb_buffer_serialize_list_formats checkUnexpectedReturnNULL "bufferSerializeListFormats" result result' <- unpackZeroTerminatedUTF8CArray result return result' -- function buffer_serialize_glyphs -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_buffer_t buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the first item in @buffer to serialize." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "end" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the last item in @buffer to serialize." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buf" -- , argType = TCArray False (-1) 4 (TBasicType TUInt8) -- , argCType = Just "char*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "output string to\n write serialized buffer into." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "buf_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the size of @buf." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "buf_consumed" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "if not `NULL`, will be set to the number of bytes written into @buf." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the #hb_font_t used to shape this buffer, needed to\n read glyph names and extents. If `NULL`, an empty font will be used." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "format" -- , argType = -- TInterface -- Name -- { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" } -- , argCType = Just "hb_buffer_serialize_format_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the #hb_buffer_serialize_format_t to use for formatting the output." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "buffer_serialize_flags_t" } -- , argCType = Just "hb_buffer_serialize_flags_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the #hb_buffer_serialize_flags_t that control what glyph properties\n to serialize." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "buf_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the size of @buf." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_serialize_glyphs" hb_buffer_serialize_glyphs :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- start : TBasicType TUInt Word32 -> -- end : TBasicType TUInt Ptr (Ptr Word8) -> -- buf : TCArray False (-1) 4 (TBasicType TUInt8) Ptr Word32 -> -- buf_size : TBasicType TUInt Ptr Word32 -> -- buf_consumed : TBasicType TUInt Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"}) CUInt -> -- flags : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_flags_t"}) IO Word32 -- | Serializes /@buffer@/ into a textual representation of its glyph content, -- useful for showing the contents of the buffer, for example during debugging. -- There are currently two supported serialization formats: -- -- == text -- A human-readable, plain text format. -- The serialized glyphs will look something like: -- -- -- -- >[uni0651=0@518,0+0|uni0628=0+1897] -- -- -- * The serialized glyphs are delimited with @[@ and @]@. -- * Glyphs are separated with @|@ -- * Each glyph starts with glyph name, or glyph index if -- @/HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES/@ flag is set. Then, -- -- * If @/HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS/@ is not set, @=@ then t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'.@/cluster/@. -- * If @/HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS/@ is not set, the t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT' in the format: -- -- * If t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/x_offset/@ and t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/y_offset/@ are not both 0, @\@x_offset,y_offset@. Then, -- * @+x_advance@, then @,y_advance@ if t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/y_advance/@ is not 0. Then, -- -- * If @/HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS/@ is set, the t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT' in the format @\<x_bearing,y_bearing,width,height>@ -- -- -- == json -- A machine-readable, structured format. -- The serialized glyphs will look something like: -- -- -- -- >[{"g":"uni0651","cl":0,"dx":518,"dy":0,"ax":0,"ay":0}, -- >{"g":"uni0628","cl":0,"dx":0,"dy":0,"ax":1897,"ay":0}] -- -- -- Each glyph is a JSON object, with the following properties: -- * @g@: the glyph name or glyph index if -- @/HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES/@ flag is set. -- * @cl@: t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'.@/cluster/@ if -- @/HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS/@ is not set. -- * @dx@,@dy@,@ax@,@ay@: t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/x_offset/@, t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/y_offset/@, -- t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/x_advance/@ and t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/y_advance/@ -- respectively, if @/HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS/@ is not set. -- * @xb@,@yb@,@w@,@h@: t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT'.@/x_bearing/@, t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT'.@/y_bearing/@, -- t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT'.@/width/@ and t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT'.@/height/@ respectively if -- @/HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS/@ is set. -- -- -- /Since: 0.9.7/ bufferSerializeGlyphs :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' buffer. -> Word32 -- ^ /@start@/: the first item in /@buffer@/ to serialize. -> Word32 -- ^ /@end@/: the last item in /@buffer@/ to serialize. -> Maybe (HarfBuzz.FontT.FontT) -- ^ /@font@/: the t'GI.HarfBuzz.Structs.FontT.FontT' used to shape this buffer, needed to -- read glyph names and extents. If @NULL@, an empty font will be used. -> [HarfBuzz.Flags.BufferSerializeFormatT] -- ^ /@format@/: the t'GI.HarfBuzz.Flags.BufferSerializeFormatT' to use for formatting the output. -> [HarfBuzz.Flags.BufferSerializeFlagsT] -- ^ /@flags@/: the t'GI.HarfBuzz.Flags.BufferSerializeFlagsT' that control what glyph properties -- to serialize. -> m ((Word32, ByteString, Word32)) -- ^ __Returns:__ The number of serialized items. bufferSerializeGlyphs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> Word32 -> Maybe FontT -> [BufferSerializeFormatT] -> [BufferSerializeFlagsT] -> m (Word32, ByteString, Word32) bufferSerializeGlyphs BufferT buffer Word32 start Word32 end Maybe FontT font [BufferSerializeFormatT] format [BufferSerializeFlagsT] flags = IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32)) -> IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32) forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer buf <- callocMem :: IO (Ptr (Ptr Word8)) bufSize <- allocMem :: IO (Ptr Word32) bufConsumed <- allocMem :: IO (Ptr Word32) maybeFont <- case font of Maybe FontT Nothing -> Ptr FontT -> IO (Ptr FontT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr FontT forall a. Ptr a FP.nullPtr Just FontT jFont -> do jFont' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT jFont return jFont' let format' = [BufferSerializeFormatT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BufferSerializeFormatT] format let flags' = [BufferSerializeFlagsT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BufferSerializeFlagsT] flags result <- hb_buffer_serialize_glyphs buffer' start end buf bufSize bufConsumed maybeFont format' flags' bufSize' <- peek bufSize buf' <- peek buf buf'' <- (unpackByteStringWithLength bufSize') buf' freeMem buf' bufConsumed' <- peek bufConsumed touchManagedPtr buffer whenJust font touchManagedPtr freeMem buf freeMem bufSize freeMem bufConsumed return (result, buf'', bufConsumed') -- function buffer_serialize_format_to_string -- Args: [ Arg -- { argCName = "format" -- , argType = -- TInterface -- Name -- { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" } -- , argCType = Just "hb_buffer_serialize_format_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_buffer_serialize_format_t to convert." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_serialize_format_to_string" hb_buffer_serialize_format_to_string :: CUInt -> -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"}) IO CString -- | Converts /@format@/ to the string corresponding it, or @NULL@ if it is not a valid -- t'GI.HarfBuzz.Flags.BufferSerializeFormatT'. -- -- /Since: 0.9.7/ bufferSerializeFormatToString :: (B.CallStack.HasCallStack, MonadIO m) => [HarfBuzz.Flags.BufferSerializeFormatT] -- ^ /@format@/: an t'GI.HarfBuzz.Flags.BufferSerializeFormatT' to convert. -> m T.Text -- ^ __Returns:__ -- A @NULL@ terminated string corresponding to /@format@/. Should not be freed. bufferSerializeFormatToString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [BufferSerializeFormatT] -> m Text bufferSerializeFormatToString [BufferSerializeFormatT] format = IO Text -> m Text forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Text -> m Text) -> IO Text -> m Text forall a b. (a -> b) -> a -> b $ do let format' :: CUInt format' = [BufferSerializeFormatT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BufferSerializeFormatT] format result <- CUInt -> IO (Ptr CChar) hb_buffer_serialize_format_to_string CUInt format' checkUnexpectedReturnNULL "bufferSerializeFormatToString" result result' <- cstringToText result return result' -- function buffer_serialize_format_from_string -- Args: [ Arg -- { argCName = "str" -- , argType = TCArray False (-1) 1 (TBasicType TUInt8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a string to parse" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "length of @str, or -1 if string is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "length of @str, or -1 if string is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just -- (TInterface -- Name -- { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_serialize_format_from_string" hb_buffer_serialize_format_from_string :: Ptr Word8 -> -- str : TCArray False (-1) 1 (TBasicType TUInt8) Int32 -> -- len : TBasicType TInt IO CUInt -- | Parses a string into an t'GI.HarfBuzz.Flags.BufferSerializeFormatT'. Does not check if -- /@str@/ is a valid buffer serialization format, use -- 'GI.HarfBuzz.Functions.bufferSerializeListFormats' to get the list of supported formats. -- -- /Since: 0.9.7/ bufferSerializeFormatFromString :: (B.CallStack.HasCallStack, MonadIO m) => ByteString -- ^ /@str@/: a string to parse -> m [HarfBuzz.Flags.BufferSerializeFormatT] -- ^ __Returns:__ The parsed t'GI.HarfBuzz.Flags.BufferSerializeFormatT'. bufferSerializeFormatFromString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ByteString -> m [BufferSerializeFormatT] bufferSerializeFormatFromString ByteString str = IO [BufferSerializeFormatT] -> m [BufferSerializeFormatT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [BufferSerializeFormatT] -> m [BufferSerializeFormatT]) -> IO [BufferSerializeFormatT] -> m [BufferSerializeFormatT] forall a b. (a -> b) -> a -> b $ do let len :: Int32 len = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString str str' <- ByteString -> IO (Ptr Word8) packByteString ByteString str result <- hb_buffer_serialize_format_from_string str' len let result' = CUInt -> [BufferSerializeFormatT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result freeMem str' return result' -- function buffer_serialize -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_buffer_t buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the first item in @buffer to serialize." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "end" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the last item in @buffer to serialize." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buf" -- , argType = TCArray False (-1) 4 (TBasicType TUInt8) -- , argCType = Just "char*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "output string to\n write serialized buffer into." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "buf_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the size of @buf." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "buf_consumed" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "if not `NULL`, will be set to the number of bytes written into @buf." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the #hb_font_t used to shape this buffer, needed to\n read glyph names and extents. If `NULL`, an empty font will be used." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "format" -- , argType = -- TInterface -- Name -- { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" } -- , argCType = Just "hb_buffer_serialize_format_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the #hb_buffer_serialize_format_t to use for formatting the output." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "buffer_serialize_flags_t" } -- , argCType = Just "hb_buffer_serialize_flags_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the #hb_buffer_serialize_flags_t that control what glyph properties\n to serialize." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "buf_size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the size of @buf." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_serialize" hb_buffer_serialize :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- start : TBasicType TUInt Word32 -> -- end : TBasicType TUInt Ptr (Ptr Word8) -> -- buf : TCArray False (-1) 4 (TBasicType TUInt8) Ptr Word32 -> -- buf_size : TBasicType TUInt Ptr Word32 -> -- buf_consumed : TBasicType TUInt Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"}) CUInt -> -- flags : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_flags_t"}) IO Word32 -- | Serializes /@buffer@/ into a textual representation of its content, whether -- Unicode codepoints or glyph identifiers and positioning information. This is -- useful for showing the contents of the buffer, for example during debugging. -- See the documentation of 'GI.HarfBuzz.Functions.bufferSerializeUnicode' and -- 'GI.HarfBuzz.Functions.bufferSerializeGlyphs' for a description of the output format. -- -- /Since: 2.7.3/ bufferSerialize :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' buffer. -> Word32 -- ^ /@start@/: the first item in /@buffer@/ to serialize. -> Word32 -- ^ /@end@/: the last item in /@buffer@/ to serialize. -> Maybe (HarfBuzz.FontT.FontT) -- ^ /@font@/: the t'GI.HarfBuzz.Structs.FontT.FontT' used to shape this buffer, needed to -- read glyph names and extents. If @NULL@, an empty font will be used. -> [HarfBuzz.Flags.BufferSerializeFormatT] -- ^ /@format@/: the t'GI.HarfBuzz.Flags.BufferSerializeFormatT' to use for formatting the output. -> [HarfBuzz.Flags.BufferSerializeFlagsT] -- ^ /@flags@/: the t'GI.HarfBuzz.Flags.BufferSerializeFlagsT' that control what glyph properties -- to serialize. -> m ((Word32, ByteString, Word32)) -- ^ __Returns:__ The number of serialized items. bufferSerialize :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> Word32 -> Maybe FontT -> [BufferSerializeFormatT] -> [BufferSerializeFlagsT] -> m (Word32, ByteString, Word32) bufferSerialize BufferT buffer Word32 start Word32 end Maybe FontT font [BufferSerializeFormatT] format [BufferSerializeFlagsT] flags = IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32)) -> IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32) forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer buf <- callocMem :: IO (Ptr (Ptr Word8)) bufSize <- allocMem :: IO (Ptr Word32) bufConsumed <- allocMem :: IO (Ptr Word32) maybeFont <- case font of Maybe FontT Nothing -> Ptr FontT -> IO (Ptr FontT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr FontT forall a. Ptr a FP.nullPtr Just FontT jFont -> do jFont' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT jFont return jFont' let format' = [BufferSerializeFormatT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BufferSerializeFormatT] format let flags' = [BufferSerializeFlagsT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BufferSerializeFlagsT] flags result <- hb_buffer_serialize buffer' start end buf bufSize bufConsumed maybeFont format' flags' bufSize' <- peek bufSize buf' <- peek buf buf'' <- (unpackByteStringWithLength bufSize') buf' freeMem buf' bufConsumed' <- peek bufConsumed touchManagedPtr buffer whenJust font touchManagedPtr freeMem buf freeMem bufSize freeMem bufConsumed return (result, buf'', bufConsumed') -- function buffer_reverse_range -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "start index" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "end" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "end index" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_reverse_range" hb_buffer_reverse_range :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- start : TBasicType TUInt Word32 -> -- end : TBasicType TUInt IO () -- | Reverses buffer contents between /@start@/ and /@end@/. -- -- /Since: 0.9.41/ bufferReverseRange :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> Word32 -- ^ /@start@/: start index -> Word32 -- ^ /@end@/: end index -> m () bufferReverseRange :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> Word32 -> m () bufferReverseRange BufferT buffer Word32 start Word32 end = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_reverse_range buffer' start end touchManagedPtr buffer return () -- function buffer_reverse_clusters -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_reverse_clusters" hb_buffer_reverse_clusters :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO () -- | Reverses buffer clusters. That is, the buffer contents are -- reversed, then each cluster (consecutive items having the -- same cluster number) are reversed again. -- -- /Since: 0.9.2/ bufferReverseClusters :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m () bufferReverseClusters :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m () bufferReverseClusters BufferT buffer = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_reverse_clusters buffer' touchManagedPtr buffer return () -- function buffer_reverse -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_reverse" hb_buffer_reverse :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO () -- | Reverses buffer contents. -- -- /Since: 0.9.2/ bufferReverse :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m () bufferReverse :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m () bufferReverse BufferT buffer = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_reverse buffer' touchManagedPtr buffer return () -- function buffer_reset -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_reset" hb_buffer_reset :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO () -- | Resets the buffer to its initial status, as if it was just newly created -- with 'GI.HarfBuzz.Functions.bufferCreate'. -- -- /Since: 0.9.2/ bufferReset :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m () bufferReset :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m () bufferReset BufferT buffer = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_reset buffer' touchManagedPtr buffer return () -- function buffer_pre_allocate -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "size" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Number of items to pre allocate." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_pre_allocate" hb_buffer_pre_allocate :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- size : TBasicType TUInt IO Int32 -- | Pre allocates memory for /@buffer@/ to fit at least /@size@/ number of items. -- -- /Since: 0.9.2/ bufferPreAllocate :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> Word32 -- ^ /@size@/: Number of items to pre allocate. -> m Int32 -- ^ __Returns:__ @true@ if /@buffer@/ memory allocation succeeded, @false@ otherwise bufferPreAllocate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> m Int32 bufferPreAllocate BufferT buffer Word32 size = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_pre_allocate buffer' size touchManagedPtr buffer return result -- function buffer_normalize_glyphs -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_normalize_glyphs" hb_buffer_normalize_glyphs :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO () -- | Reorders a glyph buffer to have canonical in-cluster glyph order \/ position. -- The resulting clusters should behave identical to pre-reordering clusters. -- -- \<note>This has nothing to do with Unicode normalization.\<\/note> -- -- /Since: 0.9.2/ bufferNormalizeGlyphs :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m () bufferNormalizeGlyphs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m () bufferNormalizeGlyphs BufferT buffer = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_normalize_glyphs buffer' touchManagedPtr buffer return () -- function buffer_has_positions -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_buffer_t." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_has_positions" hb_buffer_has_positions :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO Int32 -- | Returns whether /@buffer@/ has glyph position data. -- A buffer gains position data when 'GI.HarfBuzz.Functions.bufferGetGlyphPositions' is called on it, -- and cleared of position data when 'GI.HarfBuzz.Functions.bufferClearContents' is called. -- -- /Since: 2.7.3/ bufferHasPositions :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT'. -> m Int32 -- ^ __Returns:__ @true@ if the /@buffer@/ has position array, @false@ otherwise. bufferHasPositions :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m Int32 bufferHasPositions BufferT buffer = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_has_positions buffer' touchManagedPtr buffer return result -- function buffer_guess_segment_properties -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_guess_segment_properties" hb_buffer_guess_segment_properties :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO () -- | Sets unset buffer segment properties based on buffer Unicode -- contents. If buffer is not empty, it must have content type -- @/HB_BUFFER_CONTENT_TYPE_UNICODE/@. -- -- If buffer script is not set (ie. is @/HB_SCRIPT_INVALID/@), it -- will be set to the Unicode script of the first character in -- the buffer that has a script other than @/HB_SCRIPT_COMMON/@, -- @/HB_SCRIPT_INHERITED/@, and @/HB_SCRIPT_UNKNOWN/@. -- -- Next, if buffer direction is not set (ie. is @/HB_DIRECTION_INVALID/@), -- it will be set to the natural horizontal direction of the -- buffer script as returned by 'GI.HarfBuzz.Functions.scriptGetHorizontalDirection'. -- If 'GI.HarfBuzz.Functions.scriptGetHorizontalDirection' returns @/HB_DIRECTION_INVALID/@, -- then @/HB_DIRECTION_LTR/@ is used. -- -- Finally, if buffer language is not set (ie. is 'GI.HarfBuzz.Constants.LANGUAGE_INVALID'), -- it will be set to the process\'s default language as returned by -- 'GI.HarfBuzz.Functions.languageGetDefault'. This may change in the future by -- taking buffer script into consideration when choosing a language. -- Note that 'GI.HarfBuzz.Functions.languageGetDefault' is NOT threadsafe the first time -- it is called. See documentation for that function for details. -- -- /Since: 0.9.7/ bufferGuessSegmentProperties :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m () bufferGuessSegmentProperties :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m () bufferGuessSegmentProperties BufferT buffer = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_guess_segment_properties buffer' touchManagedPtr buffer return () -- function buffer_get_unicode_funcs -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_unicode_funcs" hb_buffer_get_unicode_funcs :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) -- | Fetches the Unicode-functions structure of a buffer. -- -- /Since: 0.9.2/ bufferGetUnicodeFuncs :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -- ^ __Returns:__ The Unicode-functions structure bufferGetUnicodeFuncs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m UnicodeFuncsT bufferGetUnicodeFuncs BufferT buffer = IO UnicodeFuncsT -> m UnicodeFuncsT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT) -> IO UnicodeFuncsT -> m UnicodeFuncsT forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_unicode_funcs buffer' checkUnexpectedReturnNULL "bufferGetUnicodeFuncs" result result' <- (wrapBoxed HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) result touchManagedPtr buffer return result' -- function buffer_get_segment_properties -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "props" -- , argType = -- TInterface -- Name { namespace = "HarfBuzz" , name = "segment_properties_t" } -- , argCType = Just "hb_segment_properties_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The output #hb_segment_properties_t" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_segment_properties" hb_buffer_get_segment_properties :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"}) IO () -- | Sets /@props@/ to the t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' of /@buffer@/. -- -- /Since: 0.9.7/ bufferGetSegmentProperties :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m (HarfBuzz.SegmentPropertiesT.SegmentPropertiesT) bufferGetSegmentProperties :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m SegmentPropertiesT bufferGetSegmentProperties BufferT buffer = IO SegmentPropertiesT -> m SegmentPropertiesT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO SegmentPropertiesT -> m SegmentPropertiesT) -> IO SegmentPropertiesT -> m SegmentPropertiesT forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer props <- SP.callocBoxedBytes 20 :: IO (Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT) hb_buffer_get_segment_properties buffer' props props' <- (wrapBoxed HarfBuzz.SegmentPropertiesT.SegmentPropertiesT) props touchManagedPtr buffer return props' -- function buffer_get_script -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "script_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_script" hb_buffer_get_script :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO CUInt -- | Fetches the script of /@buffer@/. -- -- /Since: 0.9.2/ bufferGetScript :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m [HarfBuzz.Flags.ScriptT] -- ^ __Returns:__ The t'GI.HarfBuzz.Flags.ScriptT' of the /@buffer@/ bufferGetScript :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m [ScriptT] bufferGetScript BufferT buffer = IO [ScriptT] -> m [ScriptT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [ScriptT] -> m [ScriptT]) -> IO [ScriptT] -> m [ScriptT] forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_script buffer' let result' = CUInt -> [ScriptT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result touchManagedPtr buffer return result' -- function buffer_get_replacement_codepoint -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_replacement_codepoint" hb_buffer_get_replacement_codepoint :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO Word32 -- | Fetches the @/hb_codepoint_t/@ that replaces invalid entries for a given encoding -- when adding text to /@buffer@/. -- -- /Since: 0.9.31/ bufferGetReplacementCodepoint :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m Word32 -- ^ __Returns:__ The /@buffer@/ replacement @/hb_codepoint_t/@ bufferGetReplacementCodepoint :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m Word32 bufferGetReplacementCodepoint BufferT buffer = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_replacement_codepoint buffer' touchManagedPtr buffer return result -- function buffer_get_random_state -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_random_state" hb_buffer_get_random_state :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO Word32 -- | See 'GI.HarfBuzz.Functions.bufferSetRandomState'. -- -- /Since: 8.4.0/ bufferGetRandomState :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m Word32 -- ^ __Returns:__ The /@buffer@/ random state bufferGetRandomState :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m Word32 bufferGetRandomState BufferT buffer = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_random_state buffer' touchManagedPtr buffer return result -- function buffer_get_not_found_variation_selector_glyph -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_not_found_variation_selector_glyph" hb_buffer_get_not_found_variation_selector_glyph :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO Word32 -- | See 'GI.HarfBuzz.Functions.bufferSetNotFoundVariationSelectorGlyph'. -- -- /Since: 10.0.0/ bufferGetNotFoundVariationSelectorGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m Word32 -- ^ __Returns:__ The /@buffer@/ not-found-variation-selector @/hb_codepoint_t/@ bufferGetNotFoundVariationSelectorGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m Word32 bufferGetNotFoundVariationSelectorGlyph BufferT buffer = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_not_found_variation_selector_glyph buffer' touchManagedPtr buffer return result -- function buffer_get_not_found_glyph -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_not_found_glyph" hb_buffer_get_not_found_glyph :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO Word32 -- | See 'GI.HarfBuzz.Functions.bufferSetNotFoundGlyph'. -- -- /Since: 3.1.0/ bufferGetNotFoundGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m Word32 -- ^ __Returns:__ The /@buffer@/ not-found @/hb_codepoint_t/@ bufferGetNotFoundGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m Word32 bufferGetNotFoundGlyph BufferT buffer = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_not_found_glyph buffer' touchManagedPtr buffer return result -- function buffer_get_length -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_length" hb_buffer_get_length :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO Word32 -- | Returns the number of items in the buffer. -- -- /Since: 0.9.2/ bufferGetLength :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m Word32 -- ^ __Returns:__ The /@buffer@/ length. -- The value valid as long as buffer has not been modified. bufferGetLength :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m Word32 bufferGetLength BufferT buffer = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_length buffer' touchManagedPtr buffer return result -- function buffer_get_language -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "language_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_language" hb_buffer_get_language :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO (Ptr HarfBuzz.LanguageT.LanguageT) -- | See 'GI.HarfBuzz.Functions.bufferSetLanguage'. -- -- /Since: 0.9.2/ bufferGetLanguage :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m HarfBuzz.LanguageT.LanguageT -- ^ __Returns:__ -- The t'GI.HarfBuzz.Structs.LanguageT.LanguageT' of the buffer. Must not be freed by the caller. bufferGetLanguage :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m LanguageT bufferGetLanguage BufferT buffer = IO LanguageT -> m LanguageT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO LanguageT -> m LanguageT) -> IO LanguageT -> m LanguageT forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_language buffer' checkUnexpectedReturnNULL "bufferGetLanguage" result result' <- (newPtr HarfBuzz.LanguageT.LanguageT) result touchManagedPtr buffer return result' -- function buffer_get_invisible_glyph -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_invisible_glyph" hb_buffer_get_invisible_glyph :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO Word32 -- | See 'GI.HarfBuzz.Functions.bufferSetInvisibleGlyph'. -- -- /Since: 2.0.0/ bufferGetInvisibleGlyph :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m Word32 -- ^ __Returns:__ The /@buffer@/ invisible @/hb_codepoint_t/@ bufferGetInvisibleGlyph :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m Word32 bufferGetInvisibleGlyph BufferT buffer = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_invisible_glyph buffer' touchManagedPtr buffer return result -- function buffer_get_glyph_positions -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The output length" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The output length" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just -- (TCArray -- False -- (-1) -- 1 -- (TInterface -- Name { namespace = "HarfBuzz" , name = "glyph_position_t" })) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_glyph_positions" hb_buffer_get_glyph_positions :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr Word32 -> -- length : TBasicType TUInt IO (Ptr HarfBuzz.GlyphPositionT.GlyphPositionT) -- | Returns /@buffer@/ glyph position array. Returned pointer -- is valid as long as /@buffer@/ contents are not modified. -- -- If buffer did not have positions before, the positions will be -- initialized to zeros, unless this function is called from -- within a buffer message callback (see 'GI.HarfBuzz.Functions.bufferSetMessageFunc'), -- in which case @NULL@ is returned. -- -- /Since: 0.9.2/ bufferGetGlyphPositions :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m [HarfBuzz.GlyphPositionT.GlyphPositionT] -- ^ __Returns:__ -- The /@buffer@/ glyph position array. -- The value valid as long as buffer has not been modified. bufferGetGlyphPositions :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m [GlyphPositionT] bufferGetGlyphPositions BufferT buffer = IO [GlyphPositionT] -> m [GlyphPositionT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [GlyphPositionT] -> m [GlyphPositionT]) -> IO [GlyphPositionT] -> m [GlyphPositionT] forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer length_ <- allocMem :: IO (Ptr Word32) result <- hb_buffer_get_glyph_positions buffer' length_ length_' <- peek length_ checkUnexpectedReturnNULL "bufferGetGlyphPositions" result result' <- (unpackBoxedArrayWithLength 20 length_') result result'' <- mapM (newBoxed HarfBuzz.GlyphPositionT.GlyphPositionT) result' touchManagedPtr buffer freeMem length_ return result'' -- function buffer_get_glyph_infos -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The output-array length." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The output-array length." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just -- (TCArray -- False -- (-1) -- 1 -- (TInterface -- Name { namespace = "HarfBuzz" , name = "glyph_info_t" })) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_glyph_infos" hb_buffer_get_glyph_infos :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr Word32 -> -- length : TBasicType TUInt IO (Ptr HarfBuzz.GlyphInfoT.GlyphInfoT) -- | Returns /@buffer@/ glyph information array. Returned pointer -- is valid as long as /@buffer@/ contents are not modified. -- -- /Since: 0.9.2/ bufferGetGlyphInfos :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m [HarfBuzz.GlyphInfoT.GlyphInfoT] -- ^ __Returns:__ -- The /@buffer@/ glyph information array. -- The value valid as long as buffer has not been modified. bufferGetGlyphInfos :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m [GlyphInfoT] bufferGetGlyphInfos BufferT buffer = IO [GlyphInfoT] -> m [GlyphInfoT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [GlyphInfoT] -> m [GlyphInfoT]) -> IO [GlyphInfoT] -> m [GlyphInfoT] forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer length_ <- allocMem :: IO (Ptr Word32) result <- hb_buffer_get_glyph_infos buffer' length_ length_' <- peek length_ checkUnexpectedReturnNULL "bufferGetGlyphInfos" result result' <- (unpackBoxedArrayWithLength 20 length_') result result'' <- mapM (newBoxed HarfBuzz.GlyphInfoT.GlyphInfoT) result' touchManagedPtr buffer freeMem length_ return result'' -- function buffer_get_flags -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "buffer_flags_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_flags" hb_buffer_get_flags :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO CUInt -- | Fetches the t'GI.HarfBuzz.Flags.BufferFlagsT' of /@buffer@/. -- -- /Since: 0.9.7/ bufferGetFlags :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m [HarfBuzz.Flags.BufferFlagsT] -- ^ __Returns:__ The /@buffer@/ flags bufferGetFlags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m [BufferFlagsT] bufferGetFlags BufferT buffer = IO [BufferFlagsT] -> m [BufferFlagsT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [BufferFlagsT] -> m [BufferFlagsT]) -> IO [BufferFlagsT] -> m [BufferFlagsT] forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_flags buffer' let result' = CUInt -> [BufferFlagsT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result touchManagedPtr buffer return result' -- function buffer_get_empty -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_empty" hb_buffer_get_empty :: IO (Ptr HarfBuzz.BufferT.BufferT) -- | Fetches an empty t'GI.HarfBuzz.Structs.BufferT.BufferT'. -- -- /Since: 0.9.2/ bufferGetEmpty :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.BufferT.BufferT -- ^ __Returns:__ The empty buffer bufferGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m BufferT bufferGetEmpty = IO BufferT -> m BufferT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BufferT -> m BufferT) -> IO BufferT -> m BufferT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr BufferT) hb_buffer_get_empty checkUnexpectedReturnNULL "bufferGetEmpty" result result' <- (wrapBoxed HarfBuzz.BufferT.BufferT) result return result' -- function buffer_get_direction -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_direction" hb_buffer_get_direction :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO CUInt -- | See 'GI.HarfBuzz.Functions.bufferSetDirection' -- -- /Since: 0.9.2/ bufferGetDirection :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m HarfBuzz.Enums.DirectionT -- ^ __Returns:__ The direction of the /@buffer@/. bufferGetDirection :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m DirectionT bufferGetDirection BufferT buffer = IO DirectionT -> m DirectionT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO DirectionT -> m DirectionT) -> IO DirectionT -> m DirectionT forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_direction buffer' let result' = (Int -> DirectionT forall a. Enum a => Int -> a toEnum (Int -> DirectionT) -> (CUInt -> Int) -> CUInt -> DirectionT forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result touchManagedPtr buffer return result' -- function buffer_get_content_type -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "buffer_content_type_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_content_type" hb_buffer_get_content_type :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO CUInt -- | Fetches the type of /@buffer@/ contents. Buffers are either empty, contain -- characters (before shaping), or contain glyphs (the result of shaping). -- -- /Since: 0.9.5/ bufferGetContentType :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m HarfBuzz.Enums.BufferContentTypeT -- ^ __Returns:__ The type of /@buffer@/ contents bufferGetContentType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m BufferContentTypeT bufferGetContentType BufferT buffer = IO BufferContentTypeT -> m BufferContentTypeT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BufferContentTypeT -> m BufferContentTypeT) -> IO BufferContentTypeT -> m BufferContentTypeT forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_content_type buffer' let result' = (Int -> BufferContentTypeT forall a. Enum a => Int -> a toEnum (Int -> BufferContentTypeT) -> (CUInt -> Int) -> CUInt -> BufferContentTypeT forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result touchManagedPtr buffer return result' -- function buffer_get_cluster_level -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "buffer_cluster_level_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_get_cluster_level" hb_buffer_get_cluster_level :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO CUInt -- | Fetches the cluster level of a buffer. The t'GI.HarfBuzz.Enums.BufferClusterLevelT' -- dictates one aspect of how HarfBuzz will treat non-base characters -- during shaping. -- -- /Since: 0.9.42/ bufferGetClusterLevel :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m HarfBuzz.Enums.BufferClusterLevelT -- ^ __Returns:__ The cluster level of /@buffer@/ bufferGetClusterLevel :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m BufferClusterLevelT bufferGetClusterLevel BufferT buffer = IO BufferClusterLevelT -> m BufferClusterLevelT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BufferClusterLevelT -> m BufferClusterLevelT) -> IO BufferClusterLevelT -> m BufferClusterLevelT forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_get_cluster_level buffer' let result' = (Int -> BufferClusterLevelT forall a. Enum a => Int -> a toEnum (Int -> BufferClusterLevelT) -> (CUInt -> Int) -> CUInt -> BufferClusterLevelT forall b c a. (b -> c) -> (a -> b) -> a -> c . CUInt -> Int forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result touchManagedPtr buffer return result' -- function buffer_diff -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a buffer." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "reference" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "other buffer to compare to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "dottedcircle_glyph" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "glyph id of U+25CC DOTTED CIRCLE, or (hb_codepoint_t) -1." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "position_fuzz" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "allowed absolute difference in position values." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface -- Name { namespace = "HarfBuzz" , name = "buffer_diff_flags_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_diff" hb_buffer_diff :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr HarfBuzz.BufferT.BufferT -> -- reference : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- dottedcircle_glyph : TBasicType TUInt32 Word32 -> -- position_fuzz : TBasicType TUInt IO CUInt -- | If dottedcircle_glyph is (hb_codepoint_t) -1 then @/HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT/@ -- and @/HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT/@ are never returned. This should be used by most -- callers if just comparing two buffers is needed. -- -- /Since: 1.5.0/ bufferDiff :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: a buffer. -> HarfBuzz.BufferT.BufferT -- ^ /@reference@/: other buffer to compare to. -> Word32 -- ^ /@dottedcircleGlyph@/: glyph id of U+25CC DOTTED CIRCLE, or (hb_codepoint_t) -1. -> Word32 -- ^ /@positionFuzz@/: allowed absolute difference in position values. -> m [HarfBuzz.Flags.BufferDiffFlagsT] bufferDiff :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> BufferT -> Word32 -> Word32 -> m [BufferDiffFlagsT] bufferDiff BufferT buffer BufferT reference Word32 dottedcircleGlyph Word32 positionFuzz = IO [BufferDiffFlagsT] -> m [BufferDiffFlagsT] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [BufferDiffFlagsT] -> m [BufferDiffFlagsT]) -> IO [BufferDiffFlagsT] -> m [BufferDiffFlagsT] forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer reference' <- unsafeManagedPtrGetPtr reference result <- hb_buffer_diff buffer' reference' dottedcircleGlyph positionFuzz let result' = CUInt -> [BufferDiffFlagsT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags CUInt result touchManagedPtr buffer touchManagedPtr reference return result' -- function buffer_deserialize_unicode -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_buffer_t buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buf" -- , argType = TCArray False (-1) 2 (TBasicType TUTF8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "string to deserialize" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buf_len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the size of @buf, or -1 if it is `NULL`-terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "end_ptr" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "output pointer to the character after last\n consumed one." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "format" -- , argType = -- TInterface -- Name -- { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" } -- , argCType = Just "hb_buffer_serialize_format_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the #hb_buffer_serialize_format_t of the input @buf" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "buf_len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the size of @buf, or -1 if it is `NULL`-terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_deserialize_unicode" hb_buffer_deserialize_unicode :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr CString -> -- buf : TCArray False (-1) 2 (TBasicType TUTF8) Int32 -> -- buf_len : TBasicType TInt Ptr CString -> -- end_ptr : TBasicType TUTF8 CUInt -> -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"}) IO Int32 -- | Deserializes Unicode /@buffer@/ from textual representation in the format -- produced by 'GI.HarfBuzz.Functions.bufferSerializeUnicode'. -- -- /Since: 2.7.3/ bufferDeserializeUnicode :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' buffer. -> [T.Text] -- ^ /@buf@/: string to deserialize -> [HarfBuzz.Flags.BufferSerializeFormatT] -- ^ /@format@/: the t'GI.HarfBuzz.Flags.BufferSerializeFormatT' of the input /@buf@/ -> m ((Int32, T.Text)) -- ^ __Returns:__ @true@ if the full string was parsed, @false@ otherwise. bufferDeserializeUnicode :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> [Text] -> [BufferSerializeFormatT] -> m (Int32, Text) bufferDeserializeUnicode BufferT buffer [Text] buf [BufferSerializeFormatT] format = IO (Int32, Text) -> m (Int32, Text) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Text) -> m (Int32, Text)) -> IO (Int32, Text) -> m (Int32, Text) forall a b. (a -> b) -> a -> b $ do let bufLen :: Int32 bufLen = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Text] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Text] buf buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer buf' <- packUTF8CArray buf endPtr <- callocMem :: IO (Ptr CString) let format' = [BufferSerializeFormatT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BufferSerializeFormatT] format result <- hb_buffer_deserialize_unicode buffer' buf' bufLen endPtr format' endPtr' <- peek endPtr endPtr'' <- cstringToText endPtr' freeMem endPtr' touchManagedPtr buffer (mapCArrayWithLength bufLen) freeMem buf' freeMem buf' freeMem endPtr return (result, endPtr'') -- function buffer_deserialize_glyphs -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an #hb_buffer_t buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buf" -- , argType = TCArray False (-1) 2 (TBasicType TUTF8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "string to deserialize" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buf_len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the size of @buf, or -1 if it is `NULL`-terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "end_ptr" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char**" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "output pointer to the character after last\n consumed one." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "font" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "font_t" } -- , argCType = Just "hb_font_t*" -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "font for getting glyph IDs" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "format" -- , argType = -- TInterface -- Name -- { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" } -- , argCType = Just "hb_buffer_serialize_format_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the #hb_buffer_serialize_format_t of the input @buf" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "buf_len" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the size of @buf, or -1 if it is `NULL`-terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_deserialize_glyphs" hb_buffer_deserialize_glyphs :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr CString -> -- buf : TCArray False (-1) 2 (TBasicType TUTF8) Int32 -> -- buf_len : TBasicType TInt Ptr CString -> -- end_ptr : TBasicType TUTF8 Ptr HarfBuzz.FontT.FontT -> -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"}) CUInt -> -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"}) IO Int32 -- | Deserializes glyphs /@buffer@/ from textual representation in the format -- produced by 'GI.HarfBuzz.Functions.bufferSerializeGlyphs'. -- -- /Since: 0.9.7/ bufferDeserializeGlyphs :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' buffer. -> [T.Text] -- ^ /@buf@/: string to deserialize -> Maybe (HarfBuzz.FontT.FontT) -- ^ /@font@/: font for getting glyph IDs -> [HarfBuzz.Flags.BufferSerializeFormatT] -- ^ /@format@/: the t'GI.HarfBuzz.Flags.BufferSerializeFormatT' of the input /@buf@/ -> m ((Int32, T.Text)) -- ^ __Returns:__ @true@ if the full string was parsed, @false@ otherwise. bufferDeserializeGlyphs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> [Text] -> Maybe FontT -> [BufferSerializeFormatT] -> m (Int32, Text) bufferDeserializeGlyphs BufferT buffer [Text] buf Maybe FontT font [BufferSerializeFormatT] format = IO (Int32, Text) -> m (Int32, Text) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Int32, Text) -> m (Int32, Text)) -> IO (Int32, Text) -> m (Int32, Text) forall a b. (a -> b) -> a -> b $ do let bufLen :: Int32 bufLen = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Text] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Text] buf buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer buf' <- packUTF8CArray buf endPtr <- callocMem :: IO (Ptr CString) maybeFont <- case font of Maybe FontT Nothing -> Ptr FontT -> IO (Ptr FontT) forall a. a -> IO a forall (m :: * -> *) a. Monad m => a -> m a return Ptr FontT forall a. Ptr a FP.nullPtr Just FontT jFont -> do jFont' <- FontT -> IO (Ptr FontT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FontT jFont return jFont' let format' = [BufferSerializeFormatT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BufferSerializeFormatT] format result <- hb_buffer_deserialize_glyphs buffer' buf' bufLen endPtr maybeFont format' endPtr' <- peek endPtr endPtr'' <- cstringToText endPtr' freeMem endPtr' touchManagedPtr buffer whenJust font touchManagedPtr (mapCArrayWithLength bufLen) freeMem buf' freeMem buf' freeMem endPtr return (result, endPtr'') -- function buffer_create_similar -- Args: [ Arg -- { argCName = "src" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_create_similar" hb_buffer_create_similar :: Ptr HarfBuzz.BufferT.BufferT -> -- src : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO (Ptr HarfBuzz.BufferT.BufferT) -- | Creates a new t'GI.HarfBuzz.Structs.BufferT.BufferT', similar to 'GI.HarfBuzz.Functions.bufferCreate'. The only -- difference is that the buffer is configured similarly to /@src@/. -- -- /Since: 3.3.0/ bufferCreateSimilar :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@src@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m HarfBuzz.BufferT.BufferT -- ^ __Returns:__ -- A newly allocated t'GI.HarfBuzz.Structs.BufferT.BufferT', similar to 'GI.HarfBuzz.Functions.bufferCreate'. bufferCreateSimilar :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m BufferT bufferCreateSimilar BufferT src = IO BufferT -> m BufferT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BufferT -> m BufferT) -> IO BufferT -> m BufferT forall a b. (a -> b) -> a -> b $ do src' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT src result <- hb_buffer_create_similar src' checkUnexpectedReturnNULL "bufferCreateSimilar" result result' <- (wrapBoxed HarfBuzz.BufferT.BufferT) result touchManagedPtr src return result' -- function buffer_create -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_create" hb_buffer_create :: IO (Ptr HarfBuzz.BufferT.BufferT) -- | Creates a new t'GI.HarfBuzz.Structs.BufferT.BufferT' with all properties to defaults. -- -- /Since: 0.9.2/ bufferCreate :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.BufferT.BufferT -- ^ __Returns:__ -- A newly allocated t'GI.HarfBuzz.Structs.BufferT.BufferT' with a reference count of 1. The initial -- reference count should be released with @/hb_buffer_destroy()/@ when you are done -- using the t'GI.HarfBuzz.Structs.BufferT.BufferT'. This function never returns @NULL@. If memory cannot -- be allocated, a special t'GI.HarfBuzz.Structs.BufferT.BufferT' object will be returned on which -- 'GI.HarfBuzz.Functions.bufferAllocationSuccessful' returns @false@. bufferCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m BufferT bufferCreate = IO BufferT -> m BufferT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BufferT -> m BufferT) -> IO BufferT -> m BufferT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr BufferT) hb_buffer_create checkUnexpectedReturnNULL "bufferCreate" result result' <- (wrapBoxed HarfBuzz.BufferT.BufferT) result return result' -- function buffer_clear_contents -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_clear_contents" hb_buffer_clear_contents :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO () -- | Similar to 'GI.HarfBuzz.Functions.bufferReset', but does not clear the Unicode functions and -- the replacement code point. -- -- /Since: 0.9.11/ bufferClearContents :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m () bufferClearContents :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m () bufferClearContents BufferT buffer = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_clear_contents buffer' touchManagedPtr buffer return () -- function buffer_append -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "source" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "const hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "source #hb_buffer_t" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "start index into source buffer to copy. Use 0 to copy from start of buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "end" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "end index into source buffer to copy. Use @UINT_MAX (or ((unsigned int) -1)) to copy to end of buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_append" hb_buffer_append :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr HarfBuzz.BufferT.BufferT -> -- source : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- start : TBasicType TUInt Word32 -> -- end : TBasicType TUInt IO () -- | Append (part of) contents of another buffer to this buffer. -- -- /Since: 1.5.0/ bufferAppend :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> HarfBuzz.BufferT.BufferT -- ^ /@source@/: source t'GI.HarfBuzz.Structs.BufferT.BufferT' -> Word32 -- ^ /@start@/: start index into source buffer to copy. Use 0 to copy from start of buffer. -> Word32 -- ^ /@end@/: end index into source buffer to copy. Use /@uINTMAX@/ (or ((unsigned int) -1)) to copy to end of buffer. -> m () bufferAppend :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> BufferT -> Word32 -> Word32 -> m () bufferAppend BufferT buffer BufferT source Word32 start Word32 end = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer source' <- unsafeManagedPtrGetPtr source hb_buffer_append buffer' source' start end touchManagedPtr buffer touchManagedPtr source return () -- function buffer_allocation_successful -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_buffer_allocation_successful" hb_buffer_allocation_successful :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) IO Int32 -- | Check if allocating memory for the buffer succeeded. -- -- /Since: 0.9.2/ bufferAllocationSuccessful :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> m Int32 -- ^ __Returns:__ @true@ if /@buffer@/ memory allocation succeeded, @false@ otherwise. bufferAllocationSuccessful :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m Int32 bufferAllocationSuccessful BufferT buffer = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer result <- hb_buffer_allocation_successful buffer' touchManagedPtr buffer return result -- function buffer_add_utf8 -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text" -- , argType = TCArray False (-1) 2 (TBasicType TUInt8) -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "An array of UTF-8\n characters to append." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The length of the @text, or -1 if it is `NULL` terminated." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "item_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The offset of the first character to add to the @buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "item_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The number of characters to add to the @buffer, or -1 for the\n end of @text (assuming it is `NULL` terminated)." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "text_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The length of the @text, or -1 if it is `NULL` terminated." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_add_utf8" hb_buffer_add_utf8 :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr Word8 -> -- text : TCArray False (-1) 2 (TBasicType TUInt8) Int32 -> -- text_length : TBasicType TInt Word32 -> -- item_offset : TBasicType TUInt Int32 -> -- item_length : TBasicType TInt IO () -- | See 'GI.HarfBuzz.Functions.bufferAddCodepoints'. -- -- Replaces invalid UTF-8 characters with the /@buffer@/ replacement code point, -- see 'GI.HarfBuzz.Functions.bufferSetReplacementCodepoint'. -- -- /Since: 0.9.2/ bufferAddUtf8 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> ByteString -- ^ /@text@/: An array of UTF-8 -- characters to append. -> Word32 -- ^ /@itemOffset@/: The offset of the first character to add to the /@buffer@/. -> Int32 -- ^ /@itemLength@/: The number of characters to add to the /@buffer@/, or -1 for the -- end of /@text@/ (assuming it is @NULL@ terminated). -> m () bufferAddUtf8 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> ByteString -> Word32 -> Int32 -> m () bufferAddUtf8 BufferT buffer ByteString text Word32 itemOffset Int32 itemLength = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let textLength :: Int32 textLength = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString text buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer text' <- packByteString text hb_buffer_add_utf8 buffer' text' textLength itemOffset itemLength touchManagedPtr buffer freeMem text' return () -- function buffer_add_utf32 -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text" -- , argType = TCArray False (-1) 2 (TBasicType TUInt32) -- , argCType = Just "const uint32_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An array of UTF-32 characters to append" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The length of the @text, or -1 if it is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "item_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The offset of the first character to add to the @buffer" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "item_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The number of characters to add to the @buffer, or -1 for the\n end of @text (assuming it is `NULL` terminated)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "text_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The length of the @text, or -1 if it is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_add_utf32" hb_buffer_add_utf32 :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr Word32 -> -- text : TCArray False (-1) 2 (TBasicType TUInt32) Int32 -> -- text_length : TBasicType TInt Word32 -> -- item_offset : TBasicType TUInt Int32 -> -- item_length : TBasicType TInt IO () -- | See 'GI.HarfBuzz.Functions.bufferAddCodepoints'. -- -- Replaces invalid UTF-32 characters with the /@buffer@/ replacement code point, -- see 'GI.HarfBuzz.Functions.bufferSetReplacementCodepoint'. -- -- /Since: 0.9.2/ bufferAddUtf32 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> [Word32] -- ^ /@text@/: An array of UTF-32 characters to append -> Word32 -- ^ /@itemOffset@/: The offset of the first character to add to the /@buffer@/ -> Int32 -- ^ /@itemLength@/: The number of characters to add to the /@buffer@/, or -1 for the -- end of /@text@/ (assuming it is @NULL@ terminated) -> m () bufferAddUtf32 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> [Word32] -> Word32 -> Int32 -> m () bufferAddUtf32 BufferT buffer [Word32] text Word32 itemOffset Int32 itemLength = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let textLength :: Int32 textLength = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Word32] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Word32] text buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer text' <- packStorableArray text hb_buffer_add_utf32 buffer' text' textLength itemOffset itemLength touchManagedPtr buffer freeMem text' return () -- function buffer_add_utf16 -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text" -- , argType = TCArray False (-1) 2 (TBasicType TUInt16) -- , argCType = Just "const uint16_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An array of UTF-16 characters to append" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The length of the @text, or -1 if it is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "item_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The offset of the first character to add to the @buffer" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "item_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The number of characters to add to the @buffer, or -1 for the\n end of @text (assuming it is `NULL` terminated)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "text_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The length of the @text, or -1 if it is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_add_utf16" hb_buffer_add_utf16 :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr Word16 -> -- text : TCArray False (-1) 2 (TBasicType TUInt16) Int32 -> -- text_length : TBasicType TInt Word32 -> -- item_offset : TBasicType TUInt Int32 -> -- item_length : TBasicType TInt IO () -- | See 'GI.HarfBuzz.Functions.bufferAddCodepoints'. -- -- Replaces invalid UTF-16 characters with the /@buffer@/ replacement code point, -- see 'GI.HarfBuzz.Functions.bufferSetReplacementCodepoint'. -- -- /Since: 0.9.2/ bufferAddUtf16 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> [Word16] -- ^ /@text@/: An array of UTF-16 characters to append -> Word32 -- ^ /@itemOffset@/: The offset of the first character to add to the /@buffer@/ -> Int32 -- ^ /@itemLength@/: The number of characters to add to the /@buffer@/, or -1 for the -- end of /@text@/ (assuming it is @NULL@ terminated) -> m () bufferAddUtf16 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> [Word16] -> Word32 -> Int32 -> m () bufferAddUtf16 BufferT buffer [Word16] text Word32 itemOffset Int32 itemLength = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let textLength :: Int32 textLength = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Word16] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Word16] text buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer text' <- packStorableArray text hb_buffer_add_utf16 buffer' text' textLength itemOffset itemLength touchManagedPtr buffer freeMem text' return () -- function buffer_add_latin1 -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text" -- , argType = TCArray False (-1) 2 (TBasicType TUInt8) -- , argCType = Just "const uint8_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "an array of UTF-8\n characters to append" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the length of the @text, or -1 if it is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "item_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the offset of the first character to add to the @buffer" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "item_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the number of characters to add to the @buffer, or -1 for the\n end of @text (assuming it is `NULL` terminated)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "text_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the length of the @text, or -1 if it is `NULL` terminated" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_add_latin1" hb_buffer_add_latin1 :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr Word8 -> -- text : TCArray False (-1) 2 (TBasicType TUInt8) Int32 -> -- text_length : TBasicType TInt Word32 -> -- item_offset : TBasicType TUInt Int32 -> -- item_length : TBasicType TInt IO () -- | Similar to 'GI.HarfBuzz.Functions.bufferAddCodepoints', but allows only access to first 256 -- Unicode code points that can fit in 8-bit strings. -- -- \<note>Has nothing to do with non-Unicode Latin-1 encoding.\<\/note> -- -- /Since: 0.9.39/ bufferAddLatin1 :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> ByteString -- ^ /@text@/: an array of UTF-8 -- characters to append -> Word32 -- ^ /@itemOffset@/: the offset of the first character to add to the /@buffer@/ -> Int32 -- ^ /@itemLength@/: the number of characters to add to the /@buffer@/, or -1 for the -- end of /@text@/ (assuming it is @NULL@ terminated) -> m () bufferAddLatin1 :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> ByteString -> Word32 -> Int32 -> m () bufferAddLatin1 BufferT buffer ByteString text Word32 itemOffset Int32 itemLength = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let textLength :: Int32 textLength = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString text buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer text' <- packByteString text hb_buffer_add_latin1 buffer' text' textLength itemOffset itemLength touchManagedPtr buffer freeMem text' return () -- function buffer_add_codepoints -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #hb_buffer_t to append characters to." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text" -- , argType = TCArray False (-1) 2 (TBasicType TUInt32) -- , argCType = Just "const hb_codepoint_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an array of Unicode code points to append." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "text_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the length of the @text, or -1 if it is `NULL` terminated." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "item_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the offset of the first code point to add to the @buffer." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "item_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the number of code points to add to the @buffer, or -1 for the\n end of @text (assuming it is `NULL` terminated)." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "text_length" -- , argType = TBasicType TInt -- , argCType = Just "int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the length of the @text, or -1 if it is `NULL` terminated." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_add_codepoints" hb_buffer_add_codepoints :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Ptr Word32 -> -- text : TCArray False (-1) 2 (TBasicType TUInt32) Int32 -> -- text_length : TBasicType TInt Word32 -> -- item_offset : TBasicType TUInt Int32 -> -- item_length : TBasicType TInt IO () -- | Appends characters from /@text@/ array to /@buffer@/. The /@itemOffset@/ is the -- position of the first character from /@text@/ that will be appended, and -- /@itemLength@/ is the number of character. When shaping part of a larger text -- (e.g. a run of text from a paragraph), instead of passing just the substring -- corresponding to the run, it is preferable to pass the whole -- paragraph and specify the run start and length as /@itemOffset@/ and -- /@itemLength@/, respectively, to give HarfBuzz the full context to be able, -- for example, to do cross-run Arabic shaping or properly handle combining -- marks at stat of run. -- -- This function does not check the validity of /@text@/, it is up to the caller -- to ensure it contains a valid Unicode scalar values. In contrast, -- 'GI.HarfBuzz.Functions.bufferAddUtf32' can be used that takes similar input but performs -- sanity-check on the input. -- -- /Since: 0.9.31/ bufferAddCodepoints :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: a t'GI.HarfBuzz.Structs.BufferT.BufferT' to append characters to. -> [Word32] -- ^ /@text@/: an array of Unicode code points to append. -> Word32 -- ^ /@itemOffset@/: the offset of the first code point to add to the /@buffer@/. -> Int32 -- ^ /@itemLength@/: the number of code points to add to the /@buffer@/, or -1 for the -- end of /@text@/ (assuming it is @NULL@ terminated). -> m () bufferAddCodepoints :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> [Word32] -> Word32 -> Int32 -> m () bufferAddCodepoints BufferT buffer [Word32] text Word32 itemOffset Int32 itemLength = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do let textLength :: Int32 textLength = Int -> Int32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int32) -> Int -> Int32 forall a b. (a -> b) -> a -> b $ [Word32] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [Word32] text buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer text' <- packStorableArray text hb_buffer_add_codepoints buffer' text' textLength itemOffset itemLength touchManagedPtr buffer freeMem text' return () -- function buffer_add -- Args: [ Arg -- { argCName = "buffer" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" } -- , argCType = Just "hb_buffer_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "codepoint" -- , argType = TBasicType TUInt32 -- , argCType = Just "hb_codepoint_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A Unicode code point." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cluster" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The cluster value of @codepoint." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_buffer_add" hb_buffer_add :: Ptr HarfBuzz.BufferT.BufferT -> -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"}) Word32 -> -- codepoint : TBasicType TUInt32 Word32 -> -- cluster : TBasicType TUInt IO () -- | Appends a character with the Unicode value of /@codepoint@/ to /@buffer@/, and -- gives it the initial cluster value of /@cluster@/. Clusters can be any thing -- the client wants, they are usually used to refer to the index of the -- character in the input text stream and are output in -- t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'.@/cluster/@ field. -- -- This function does not check the validity of /@codepoint@/, it is up to the -- caller to ensure it is a valid Unicode code point. -- -- /Since: 0.9.7/ bufferAdd :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BufferT.BufferT -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' -> Word32 -- ^ /@codepoint@/: A Unicode code point. -> Word32 -- ^ /@cluster@/: The cluster value of /@codepoint@/. -> m () bufferAdd :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> Word32 -> Word32 -> m () bufferAdd BufferT buffer Word32 codepoint Word32 cluster = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do buffer' <- BufferT -> IO (Ptr BufferT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BufferT buffer hb_buffer_add buffer' codepoint cluster touchManagedPtr buffer return () -- function blob_make_immutable -- Args: [ Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a blob" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "hb_blob_make_immutable" hb_blob_make_immutable :: Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) IO () -- | Makes a blob immutable. -- -- /Since: 0.9.2/ blobMakeImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@blob@/: a blob -> m () blobMakeImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> m () blobMakeImmutable BlobT blob = IO () -> m () forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO () -> m ()) -> IO () -> m () forall a b. (a -> b) -> a -> b $ do blob' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT blob hb_blob_make_immutable blob' touchManagedPtr blob return () -- function blob_is_immutable -- Args: [ Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a blob." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_blob_is_immutable" hb_blob_is_immutable :: Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) IO Int32 -- | Tests whether a blob is immutable. -- -- /Since: 0.9.2/ blobIsImmutable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@blob@/: a blob. -> m Int32 -- ^ __Returns:__ @true@ if /@blob@/ is immutable, @false@ otherwise blobIsImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> m Int32 blobIsImmutable BlobT blob = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do blob' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT blob result <- hb_blob_is_immutable blob' touchManagedPtr blob return result -- function blob_get_length -- Args: [ Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a blob." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_blob_get_length" hb_blob_get_length :: Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) IO Word32 -- | Fetches the length of a blob\'s data. -- -- /Since: 0.9.2/ blobGetLength :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@blob@/: a blob. -> m Word32 -- ^ __Returns:__ the length of /@blob@/ data in bytes. blobGetLength :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> m Word32 blobGetLength BlobT blob = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do blob' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT blob result <- hb_blob_get_length blob' touchManagedPtr blob return result -- function blob_get_empty -- Args: [] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_blob_get_empty" hb_blob_get_empty :: IO (Ptr HarfBuzz.BlobT.BlobT) -- | Returns the singleton empty blob. -- -- See TODO:link object types for more information. -- -- /Since: 0.9.2/ blobGetEmpty :: (B.CallStack.HasCallStack, MonadIO m) => m HarfBuzz.BlobT.BlobT -- ^ __Returns:__ The empty blob. blobGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m BlobT blobGetEmpty = IO BlobT -> m BlobT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT forall a b. (a -> b) -> a -> b $ do result <- IO (Ptr BlobT) hb_blob_get_empty checkUnexpectedReturnNULL "blobGetEmpty" result result' <- (wrapBoxed HarfBuzz.BlobT.BlobT) result return result' -- function blob_get_data_writable -- Args: [ Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a blob." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "output length of the writable data." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "output length of the writable data." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TCArray False (-1) 1 (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "hb_blob_get_data_writable" hb_blob_get_data_writable :: Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) Ptr Word32 -> -- length : TBasicType TUInt IO (Ptr CString) -- | Tries to make blob data writable (possibly copying it) and -- return pointer to data. -- -- Fails if blob has been made immutable, or if memory allocation -- fails. -- -- /Since: 0.9.2/ blobGetDataWritable :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@blob@/: a blob. -> m [T.Text] -- ^ __Returns:__ Writable blob data, -- or @NULL@ if failed. blobGetDataWritable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> m [Text] blobGetDataWritable BlobT blob = IO [Text] -> m [Text] forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text] forall a b. (a -> b) -> a -> b $ do blob' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT blob length_ <- allocMem :: IO (Ptr Word32) result <- hb_blob_get_data_writable blob' length_ length_' <- peek length_ checkUnexpectedReturnNULL "blobGetDataWritable" result result' <- (unpackUTF8CArrayWithLength length_') result touchManagedPtr blob freeMem length_ return result' -- function blob_get_data -- Args: [ Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a blob." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The length in bytes of the data retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The length in bytes of the data retrieved" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TCArray False (-1) 1 (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "hb_blob_get_data" hb_blob_get_data :: Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) Ptr Word32 -> -- length : TBasicType TUInt IO (Ptr CString) -- | Fetches the data from a blob. -- -- /Since: 0.9.2/ blobGetData :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@blob@/: a blob. -> m (Maybe [T.Text]) -- ^ __Returns:__ the byte data of /@blob@/. blobGetData :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> m (Maybe [Text]) blobGetData BlobT blob = IO (Maybe [Text]) -> m (Maybe [Text]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Maybe [Text]) -> m (Maybe [Text])) -> IO (Maybe [Text]) -> m (Maybe [Text]) forall a b. (a -> b) -> a -> b $ do blob' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT blob length_ <- allocMem :: IO (Ptr Word32) result <- hb_blob_get_data blob' length_ length_' <- peek length_ maybeResult <- convertIfNonNull result $ \Ptr (Ptr CChar) result' -> do result'' <- (Word32 -> Ptr (Ptr CChar) -> IO [Text] forall a. (HasCallStack, Integral a) => a -> Ptr (Ptr CChar) -> IO [Text] unpackUTF8CArrayWithLength Word32 length_') Ptr (Ptr CChar) result' return result'' touchManagedPtr blob freeMem length_ return maybeResult -- function blob_create_sub_blob -- Args: [ Arg -- { argCName = "parent" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Parent blob." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Start offset of sub-blob within @parent, in bytes." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "length" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Length of sub-blob." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_blob_create_sub_blob" hb_blob_create_sub_blob :: Ptr HarfBuzz.BlobT.BlobT -> -- parent : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) Word32 -> -- offset : TBasicType TUInt Word32 -> -- length : TBasicType TUInt IO (Ptr HarfBuzz.BlobT.BlobT) -- | Returns a blob that represents a range of bytes in /@parent@/. The new -- blob is always created with @/HB_MEMORY_MODE_READONLY/@, meaning that it -- will never modify data in the parent blob. The parent data is not -- expected to be modified, and will result in undefined behavior if it -- is. -- -- Makes /@parent@/ immutable. -- -- /Since: 0.9.2/ blobCreateSubBlob :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@parent@/: Parent blob. -> Word32 -- ^ /@offset@/: Start offset of sub-blob within /@parent@/, in bytes. -> Word32 -- ^ /@length@/: Length of sub-blob. -> m HarfBuzz.BlobT.BlobT -- ^ __Returns:__ New blob, or the empty blob if something failed or if -- /@length@/ is zero or /@offset@/ is beyond the end of /@parent@/\'s data. Destroy -- with @/hb_blob_destroy()/@. blobCreateSubBlob :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> Word32 -> Word32 -> m BlobT blobCreateSubBlob BlobT parent Word32 offset Word32 length_ = IO BlobT -> m BlobT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT forall a b. (a -> b) -> a -> b $ do parent' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT parent result <- hb_blob_create_sub_blob parent' offset length_ checkUnexpectedReturnNULL "blobCreateSubBlob" result result' <- (wrapBoxed HarfBuzz.BlobT.BlobT) result touchManagedPtr parent return result' -- function blob_create_from_file_or_fail -- Args: [ Arg -- { argCName = "file_name" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A filename" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_blob_create_from_file_or_fail" hb_blob_create_from_file_or_fail :: CString -> -- file_name : TBasicType TUTF8 IO (Ptr HarfBuzz.BlobT.BlobT) -- | Creates a new blob containing the data from the specified file. -- -- The filename is passed directly to the system on all platforms, -- except on Windows, where the filename is interpreted as UTF-8. -- Only if the filename is not valid UTF-8, it will be interpreted -- according to the system codepage. -- -- /Since: 2.8.2/ blobCreateFromFileOrFail :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@fileName@/: A filename -> m HarfBuzz.BlobT.BlobT -- ^ __Returns:__ An t'GI.HarfBuzz.Structs.BlobT.BlobT' pointer with the content of the file, -- or @NULL@ if failed. blobCreateFromFileOrFail :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m BlobT blobCreateFromFileOrFail Text fileName = IO BlobT -> m BlobT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT forall a b. (a -> b) -> a -> b $ do fileName' <- Text -> IO (Ptr CChar) textToCString Text fileName result <- hb_blob_create_from_file_or_fail fileName' checkUnexpectedReturnNULL "blobCreateFromFileOrFail" result result' <- (wrapBoxed HarfBuzz.BlobT.BlobT) result freeMem fileName' return result' -- function blob_create_from_file -- Args: [ Arg -- { argCName = "file_name" -- , argType = TBasicType TUTF8 -- , argCType = Just "const char*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A font filename" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_blob_create_from_file" hb_blob_create_from_file :: CString -> -- file_name : TBasicType TUTF8 IO (Ptr HarfBuzz.BlobT.BlobT) -- | Creates a new blob containing the data from the -- specified binary font file. -- -- The filename is passed directly to the system on all platforms, -- except on Windows, where the filename is interpreted as UTF-8. -- Only if the filename is not valid UTF-8, it will be interpreted -- according to the system codepage. -- -- /Since: 1.7.7/ blobCreateFromFile :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@fileName@/: A font filename -> m HarfBuzz.BlobT.BlobT -- ^ __Returns:__ An t'GI.HarfBuzz.Structs.BlobT.BlobT' pointer with the content of the file, -- or 'GI.HarfBuzz.Functions.blobGetEmpty' if failed. blobCreateFromFile :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m BlobT blobCreateFromFile Text fileName = IO BlobT -> m BlobT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT forall a b. (a -> b) -> a -> b $ do fileName' <- Text -> IO (Ptr CChar) textToCString Text fileName result <- hb_blob_create_from_file fileName' checkUnexpectedReturnNULL "blobCreateFromFile" result result' <- (wrapBoxed HarfBuzz.BlobT.BlobT) result freeMem fileName' return result' -- function blob_copy_writable_or_fail -- Args: [ Arg -- { argCName = "blob" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "blob_t" } -- , argCType = Just "hb_blob_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A blob." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }) -- throws : False -- Skip return : False foreign import ccall "hb_blob_copy_writable_or_fail" hb_blob_copy_writable_or_fail :: Ptr HarfBuzz.BlobT.BlobT -> -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"}) IO (Ptr HarfBuzz.BlobT.BlobT) -- | Makes a writable copy of /@blob@/. -- -- /Since: 1.8.0/ blobCopyWritableOrFail :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.BlobT.BlobT -- ^ /@blob@/: A blob. -> m HarfBuzz.BlobT.BlobT -- ^ __Returns:__ The new blob, or nullptr if allocation failed blobCopyWritableOrFail :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> m BlobT blobCopyWritableOrFail BlobT blob = IO BlobT -> m BlobT forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT forall a b. (a -> b) -> a -> b $ do blob' <- BlobT -> IO (Ptr BlobT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr BlobT blob result <- hb_blob_copy_writable_or_fail blob' checkUnexpectedReturnNULL "blobCopyWritableOrFail" result result' <- (wrapBoxed HarfBuzz.BlobT.BlobT) result touchManagedPtr blob return result' -- function aat_layout_has_tracking -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_aat_layout_has_tracking" hb_aat_layout_has_tracking :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether the specified face includes any tracking information -- in the @trak@ table. -- -- /Since: 2.3.0/ aatLayoutHasTracking :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise aatLayoutHasTracking :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 aatLayoutHasTracking FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_aat_layout_has_tracking face' touchManagedPtr face return result -- function aat_layout_has_substitution -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_aat_layout_has_substitution" hb_aat_layout_has_substitution :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether the specified face includes any substitutions in the -- @morx@ or @mort@ tables. -- -- \<note>Note: does not examine the @GSUB@ table.\<\/note> -- -- /Since: 2.3.0/ aatLayoutHasSubstitution :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise aatLayoutHasSubstitution :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 aatLayoutHasSubstitution FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_aat_layout_has_substitution face' touchManagedPtr face return result -- function aat_layout_has_positioning -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "hb_aat_layout_has_positioning" hb_aat_layout_has_positioning :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) IO Int32 -- | Tests whether the specified face includes any positioning information -- in the @kerx@ table. -- -- \<note>Note: does not examine the @GPOS@ table.\<\/note> -- -- /Since: 2.3.0/ aatLayoutHasPositioning :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> m Int32 -- ^ __Returns:__ @true@ if data found, @false@ otherwise aatLayoutHasPositioning :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32 aatLayoutHasPositioning FaceT face = IO Int32 -> m Int32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face result <- hb_aat_layout_has_positioning face' touchManagedPtr face return result -- function aat_layout_get_feature_types -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first feature type to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of feature types to return;\n Output = the actual number of feature types returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "features" -- , argType = -- TCArray -- False -- (-1) -- 2 -- (TInterface -- Name -- { namespace = "HarfBuzz" , name = "aat_layout_feature_type_t" }) -- , argCType = Just "hb_aat_layout_feature_type_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Array of feature types found" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "feature_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of feature types to return;\n Output = the actual number of feature types returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_aat_layout_get_feature_types" hb_aat_layout_get_feature_types :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) Word32 -> -- start_offset : TBasicType TUInt Word32 -> -- feature_count : TBasicType TUInt Ptr CUInt -> -- features : TCArray False (-1) 2 (TInterface (Name {namespace = "HarfBuzz", name = "aat_layout_feature_type_t"})) IO Word32 -- | Fetches a list of the AAT feature types included in the specified face. -- -- /Since: 2.2.0/ aatLayoutGetFeatureTypes :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> Word32 -- ^ /@startOffset@/: offset of the first feature type to retrieve -> [[HarfBuzz.Flags.AatLayoutFeatureTypeT]] -- ^ /@features@/: Array of feature types found -> m ((Word32, [[HarfBuzz.Flags.AatLayoutFeatureTypeT]])) -- ^ __Returns:__ Number of all available feature types. aatLayoutGetFeatureTypes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> Word32 -> [[AatLayoutFeatureTypeT]] -> m (Word32, [[AatLayoutFeatureTypeT]]) aatLayoutGetFeatureTypes FaceT face Word32 startOffset [[AatLayoutFeatureTypeT]] features = IO (Word32, [[AatLayoutFeatureTypeT]]) -> m (Word32, [[AatLayoutFeatureTypeT]]) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [[AatLayoutFeatureTypeT]]) -> m (Word32, [[AatLayoutFeatureTypeT]])) -> IO (Word32, [[AatLayoutFeatureTypeT]]) -> m (Word32, [[AatLayoutFeatureTypeT]]) forall a b. (a -> b) -> a -> b $ do let featureCount :: Word32 featureCount = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [[AatLayoutFeatureTypeT]] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [[AatLayoutFeatureTypeT]] features face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face let features' = ([AatLayoutFeatureTypeT] -> CUInt) -> [[AatLayoutFeatureTypeT]] -> [CUInt] forall a b. (a -> b) -> [a] -> [b] map [AatLayoutFeatureTypeT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [[AatLayoutFeatureTypeT]] features features'' <- packStorableArray features' result <- hb_aat_layout_get_feature_types face' startOffset featureCount features'' features''' <- (unpackStorableArrayWithLength featureCount) features'' let features'''' = (CUInt -> [AatLayoutFeatureTypeT]) -> [CUInt] -> [[AatLayoutFeatureTypeT]] forall a b. (a -> b) -> [a] -> [b] map CUInt -> [AatLayoutFeatureTypeT] forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] wordToGFlags [CUInt] features''' freeMem features'' touchManagedPtr face return (result, features'''') -- function aat_layout_feature_type_get_selector_infos -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_type" -- , argType = -- TInterface -- Name -- { namespace = "HarfBuzz" , name = "aat_layout_feature_type_t" } -- , argCType = Just "hb_aat_layout_feature_type_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The #hb_aat_layout_feature_type_t of the requested feature type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "start_offset" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "offset of the first feature type to retrieve" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "selector_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of selectors to return;\n Output = the actual number of selectors returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "selectors" -- , argType = -- TCArray -- False -- (-1) -- 3 -- (TInterface -- Name -- { namespace = "HarfBuzz" -- , name = "aat_layout_feature_selector_info_t" -- }) -- , argCType = Just "hb_aat_layout_feature_selector_info_t*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "\n A buffer pointer. The selectors available for the feature type queries." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "default_index" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "The index of the feature's default selector, if any" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "selector_count" -- , argType = TBasicType TUInt -- , argCType = Just "unsigned int*" -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Input = the maximum number of selectors to return;\n Output = the actual number of selectors returned (may be zero)" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferEverything -- } -- ] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_aat_layout_feature_type_get_selector_infos" hb_aat_layout_feature_type_get_selector_infos :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) CUInt -> -- feature_type : TInterface (Name {namespace = "HarfBuzz", name = "aat_layout_feature_type_t"}) Word32 -> -- start_offset : TBasicType TUInt Word32 -> -- selector_count : TBasicType TUInt Ptr HarfBuzz.AatLayoutFeatureSelectorInfoT.AatLayoutFeatureSelectorInfoT -> -- selectors : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "aat_layout_feature_selector_info_t"})) Ptr Word32 -> -- default_index : TBasicType TUInt IO Word32 -- | Fetches a list of the selectors available for the specified feature in the given face. -- -- If upon return, /@defaultIndex@/ is set to 'GI.HarfBuzz.Constants.AAT_LAYOUT_NO_SELECTOR_INDEX', then -- the feature type is non-exclusive. Otherwise, /@defaultIndex@/ is the index of -- the selector that is selected by default. -- -- /Since: 2.2.0/ aatLayoutFeatureTypeGetSelectorInfos :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> [HarfBuzz.Flags.AatLayoutFeatureTypeT] -- ^ /@featureType@/: The t'GI.HarfBuzz.Flags.AatLayoutFeatureTypeT' of the requested feature type -> Word32 -- ^ /@startOffset@/: offset of the first feature type to retrieve -> [HarfBuzz.AatLayoutFeatureSelectorInfoT.AatLayoutFeatureSelectorInfoT] -- ^ /@selectors@/: -- A buffer pointer. The selectors available for the feature type queries. -> m ((Word32, [HarfBuzz.AatLayoutFeatureSelectorInfoT.AatLayoutFeatureSelectorInfoT], Word32)) -- ^ __Returns:__ Number of all available feature selectors aatLayoutFeatureTypeGetSelectorInfos :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> [AatLayoutFeatureTypeT] -> Word32 -> [AatLayoutFeatureSelectorInfoT] -> m (Word32, [AatLayoutFeatureSelectorInfoT], Word32) aatLayoutFeatureTypeGetSelectorInfos FaceT face [AatLayoutFeatureTypeT] featureType Word32 startOffset [AatLayoutFeatureSelectorInfoT] selectors = IO (Word32, [AatLayoutFeatureSelectorInfoT], Word32) -> m (Word32, [AatLayoutFeatureSelectorInfoT], Word32) forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO (Word32, [AatLayoutFeatureSelectorInfoT], Word32) -> m (Word32, [AatLayoutFeatureSelectorInfoT], Word32)) -> IO (Word32, [AatLayoutFeatureSelectorInfoT], Word32) -> m (Word32, [AatLayoutFeatureSelectorInfoT], Word32) forall a b. (a -> b) -> a -> b $ do let selectorCount :: Word32 selectorCount = Int -> Word32 forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Word32) -> Int -> Word32 forall a b. (a -> b) -> a -> b $ [AatLayoutFeatureSelectorInfoT] -> Int forall a. [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int P.length [AatLayoutFeatureSelectorInfoT] selectors face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face let featureType' = [AatLayoutFeatureTypeT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [AatLayoutFeatureTypeT] featureType selectors' <- mapM unsafeManagedPtrGetPtr selectors selectors'' <- packBlockArray 16 selectors' defaultIndex <- allocMem :: IO (Ptr Word32) result <- hb_aat_layout_feature_type_get_selector_infos face' featureType' startOffset selectorCount selectors'' defaultIndex selectors''' <- (unpackBlockArrayWithLength 16 selectorCount) selectors'' selectors'''' <- mapM (wrapPtr HarfBuzz.AatLayoutFeatureSelectorInfoT.AatLayoutFeatureSelectorInfoT) selectors''' freeMem selectors'' defaultIndex' <- peek defaultIndex touchManagedPtr face mapM_ touchManagedPtr selectors freeMem defaultIndex return (result, selectors'''', defaultIndex') -- function aat_layout_feature_type_get_name_id -- Args: [ Arg -- { argCName = "face" -- , argType = -- TInterface Name { namespace = "HarfBuzz" , name = "face_t" } -- , argCType = Just "hb_face_t*" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "#hb_face_t to work upon" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "feature_type" -- , argType = -- TInterface -- Name -- { namespace = "HarfBuzz" , name = "aat_layout_feature_type_t" } -- , argCType = Just "hb_aat_layout_feature_type_t" -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "The #hb_aat_layout_feature_type_t of the requested feature type" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , argCallbackUserData = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "hb_aat_layout_feature_type_get_name_id" hb_aat_layout_feature_type_get_name_id :: Ptr HarfBuzz.FaceT.FaceT -> -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"}) CUInt -> -- feature_type : TInterface (Name {namespace = "HarfBuzz", name = "aat_layout_feature_type_t"}) IO Word32 -- | Fetches the name identifier of the specified feature type in the face\'s @name@ table. -- -- /Since: 2.2.0/ aatLayoutFeatureTypeGetNameId :: (B.CallStack.HasCallStack, MonadIO m) => HarfBuzz.FaceT.FaceT -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon -> [HarfBuzz.Flags.AatLayoutFeatureTypeT] -- ^ /@featureType@/: The t'GI.HarfBuzz.Flags.AatLayoutFeatureTypeT' of the requested feature type -> m Word32 -- ^ __Returns:__ Name identifier of the requested feature type aatLayoutFeatureTypeGetNameId :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> [AatLayoutFeatureTypeT] -> m Word32 aatLayoutFeatureTypeGetNameId FaceT face [AatLayoutFeatureTypeT] featureType = IO Word32 -> m Word32 forall a. IO a -> m a forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32 forall a b. (a -> b) -> a -> b $ do face' <- FaceT -> IO (Ptr FaceT) forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr FaceT face let featureType' = [AatLayoutFeatureTypeT] -> CUInt forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [AatLayoutFeatureTypeT] featureType result <- hb_aat_layout_feature_type_get_name_id face' featureType' touchManagedPtr face return result