bufferGuessSegmentProperties

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 harfbuzz.global.scriptGetHorizontalDirection. If harfbuzz.global.scriptGetHorizontalDirection returns #HB_DIRECTION_INVALID, then #HB_DIRECTION_LTR is used.

Finally, if buffer language is not set (ie. is #HB_LANGUAGE_INVALID), it will be set to the process's default language as returned by harfbuzz.global.languageGetDefault. This may change in the future by taking buffer script into consideration when choosing a language. Note that harfbuzz.global.languageGetDefault is NOT threadsafe the first time it is called. See documentation for that function for details.

void
bufferGuessSegmentProperties

Parameters

buffer harfbuzz.buffer.Buffer

An #hb_buffer_t