如题,在获取到文字图层后,怎么能知道文字的排列方向横向或纵向呢。如果要修改文字的排列方向应该如何操作,看了文档没找到相关的操作,是不支持获取和修改文字的排列方向吗?
@Luffy 有不同的方法来查找文本是垂直的还是旋转的。
对于旋转的文本,请尝试以下操作:
对于垂直文本,请尝试以下操作:
// The following code demonstrates the ability to edit the new IsStandardVerticalRomanAlignmentEnabled property. // This does not affect rendering at the moment, but only allows you to edit the property value. string src = "1346test.psd"; string output = "out_1346test.psd"; using(var image = (PsdImage) Image.Load(src)) { var textLayer = image.Layers[1] as TextLayer; var textPortion = textLayer.TextData.Items[0]; if (textPortion.Style.IsStandardVerticalRomanAlignmentEnabled) { // Correct reading } else { throw new Exception("Incorrect reading of IsStandardVerticalRomanAlignmentEnabled property value"); } textPortion.Style.IsStandardVerticalRomanAlignmentEnabled = false; textLayer.TextData.UpdateLayerData(); image.Save(output); } using(var image = (PsdImage) Image.Load(output)) { var textLayer = image.Layers[1] as TextLayer; var textPortion = textLayer.TextData.Items[0]; if (!textPortion.Style.IsStandardVerticalRomanAlignmentEnabled) { // Correct reading } else { throw new Exception("Incorrect reading of IsStandardVerticalRomanAlignmentEnabled property value"); } }