我使用 Powerpoint 对象模型在 PowerPoint 2007 中以编程方式创建演示文稿。
我运行我的程序的一些计算机将 PowerPoint 设置为希伯来语作为主要编辑语言。(要更改主要语言,请按“Office”按钮,然后按“Powerpoint 选项”,然后转到“流行”->“语言设置”->“主要编辑语言”)
在这些计算机上,当我运行我的程序时,创建的演示文稿中的所有文本(错误地)都显示为右对齐,并且项目符号出现在文本的右侧。
我可以通过编辑生成的演示文稿 PPTX 文件中的 ppt/presentation.xml 来解决这个问题。我为每个项目符号级别调整了“默认文本样式”中的 Alignment 和 RightToLeft 属性。但是,XML 编辑对于这个项目来说并不是一个好的选择。
除了单独更改每个文本框之外,如何使用对象模型(即 VBA)更改演示文稿中的默认文本方向?
谢谢你的建议,
我试过的:
我执行了Application.Presentations(1).LayoutDirection = ppDirectionLeftToRight,它改变了 PowerPoint 用户界面的方向。我也改成Application.Presentations(1).LanguageID 了美式英语。不幸的是,做这些事情并没有解决创建的演示文稿中从右到左的文本问题。
所以最后我放弃了改变参数的演讲本身,事实上直接更改ParagraphFormat.TextDirection,并ParagraphFormat.Alignment为每个Run我最初试图避免每次文本框的,自然这有预期的效果。
我在 java 上使用 iTextpdf 来生成加盖的 PDF,有时生成的 PDF 是阿拉伯语,我面临一个有趣的问题。为了让阿拉伯语页面从右到左 (RTL) 创建,我使用具有属性的表格和单元格PdfPCell.setRunDirection(PdfWriter.RUN_DIRECTION_RTL)。当我使用此属性时,阿拉伯语根本不显示,如果我避免调用此属性时正确显示阿拉伯语字符串,这意味着我不应该遇到字体问题,而且我真的不知道这是否是 iText 的问题或者我只是错过了一些东西。
这里有一小段代码正确显示了一个阿拉伯字符串:
BaseFont bf = BaseFont.createFont(Application.getBASEPATH() + "fonts/arabic.ttf",BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font trebuchetSmaller = new Font(bf, 10, 0);
PdfPTable tbl = new PdfPTable(1);
PdfPCell cell = new PdfPCell();
Paragraph paragraph = new Paragraph();
paragraph.add(new Phrase("??? ???? ??? ???? ????????"), trebuchetSmaller));
cell.addElement(paragraph);
tbl.addCell(cell);
Run Code Online (Sandbox Code Playgroud)
这里使阿拉伯字符串消失所需的更改:
BaseFont bf = BaseFont.createFont(Application.getBASEPATH() + "fonts/arabic.ttf",BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font trebuchetSmaller = new Font(bf, 10, 0);
PdfPTable tbl = new PdfPTable(1);
PdfPCell cell = new PdfPCell();
cell.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
Paragraph …Run Code Online (Sandbox Code Playgroud) 我使用ViewPager进行屏幕滑动它从左到右适用于语言的脚本,但对于实际从右到左的阿拉伯文脚本是不可行的
我可以按相反顺序刷取viewpager的页面吗?
我想通过将strings.xml文件添加到values目录并翻译所有英文字符串,将android应用程序从英语翻译为希伯来语。
我的问题是,\n像我对英语strings.xml字符串所做的那样,向希伯来语字符串添加换行符()不起作用。带换行符的英语字符串的示例:
<string name="no_group_instructions">You don\'t have a group yet!\n\nPlease choose whether to create a new group, or to join an existing one...</string>
Run Code Online (Sandbox Code Playgroud)
如何在我的非英语字符串中添加换行符?
编辑
我最终确实使用\ n在希伯来语字符串中进行了换行。我猜想,从右到左的书写(这在Android Studio中没有得到足够的支持)首先导致了问题。我通过将带有\ n的字符串从记事本直接复制到strings.xml文件来解决它,而不是直接在Android Studio中编写它。
从 iOS 11 开始,Apple 为UINavigationBar和添加了大标题显示模式,UINavigationItem效果如下:
我们可以简单地使用以下 Swift 代码打开这种效果:
navigationBar.prefersLargeTitles = true
Run Code Online (Sandbox Code Playgroud)
我的问题是我们如何使从右到左的大标题可用于东方从右到左的语言?
提前致谢。
我正在将一个包含一些数字(全部为波斯语)的字符串加载到 android TextView 中。一切都很好,直到我改变了我的自定义字体,文本数字显示为英文数字。
Expected : ????
Received : 1234
Run Code Online (Sandbox Code Playgroud)
我知道我的新字体支持波斯数字。当我使用正确显示的数字下方的代码更改数字区域设置时。
NumberFormat numberFormat = NumberFormat.getInstance(new Locale("fa", "IR"));
String newNumber = numberFormat.format(number);
Run Code Online (Sandbox Code Playgroud)
问题是我有一个字符串,很难找到数字部分并更改它。我以前的字体也很好用,我不明白这个字体有什么问题。
知道如何为所有文本视图或至少为字符串全局解决此问题吗?
如何将微调下拉文本方向设置为rtl?我知道我们可以使用常规文本,android:textDirection="rtl"但它不适用于微调下拉文本。我应该在弹出主题中实现它吗?如何?
谢谢
我正在尝试使上传文件的输入方向从引导程序 4 从右到左,但到目前为止我没有尝试过任何工作
我也尝试改变不同标签的方向
<div class="form-group">
<div class="col-md-4">
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFile" multiple lang="ar" dir="rtl">
<label class="custom-file-label text-left" for="customFile">choose files to upload</label>
</div>
</div>
<script type="text/javascript">
$('.custom-file input').change(function (e) {
var files = [];
for (var i = 0; i < $(this)[0].files.length; i++) {
files.push($(this)[0].files[i].name);
}
$(this).next('.custom-file-label').html(files.join(', '));
});
</script>
</div>
Run Code Online (Sandbox Code Playgroud)
我有一个在LTR设备(android 7.1.1)上显示很好的日期字段,
问题是在RTL设备上,日期字段内容已镜像
因此,在美国设备上,日期将正常显示:03/14/2019
在RTL android设备上,日期将如下所示:2019/14/03
包含值的TextView的代码:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/inspect_date"
android:textSize="18sp" />
<com.xerox.printerinspection.controls.DateEditText
android:id="@+id/edit_inspect_date"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/lightGray"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:drawableEnd="@android:drawable/ic_menu_my_calendar" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我像这样设置日期:
Date currentDate = Calendar.getInstance().getTime();
inspectionDateEdit.setDate(currentDate);
Run Code Online (Sandbox Code Playgroud)
解决此问题的正确方法是什么?
更新
父fragment_detail.xml标记如下所示:
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/lightGray"
android:textDirection="locale"
tools:context="com.xerox.MainActivity">
Run Code Online (Sandbox Code Playgroud) 我试图LinearLayout在 Android 的 XML 布局中设置 a 的填充。但它给了我 2 个选择 -paddingLeft和paddingStart.
有什么区别,使用更正确/更好的属性之一是什么?
我想要最好的答案,因为这需要最优质的代码。
android android-layout right-to-left android-xml android-view
right-to-left ×10
android ×5
java ×2
android-view ×1
android-xml ×1
arabic ×1
asp.net-mvc ×1
bootstrap-4 ×1
fonts ×1
hebrew ×1
ios ×1
ios11 ×1
itext ×1
line-breaks ×1
locale ×1
powerpoint ×1
text ×1
vba ×1
xml ×1