응용프로그램의 국제화가 올바로 이루어지려면 Rendition과 렌더 테이블을 지정해야 합니다. 렌더 테이블이 파일에서 지정되면 프로그램 바이너리는 주어진 로켈의 요건에 독립적으로 만들어지므로 로컬 요건에 맞추어 쉽게 사용자 정의할 수 있습니다.
렌더 테이블은 다음 구문에 의해 리소스 파일에서 지정됩니다: resource_spec:[tag[,tag]*]
이 때 tag는 rendition의 XmNtag 자원에 적합한 일부 문자열입니다.
이 줄은 지정된 바와 같이 한 개 이상의 rendition을 포함한 최초의 렌더 테이블을 만듭니다. rendition은 지정된 태그에 부착됩니다:
resource_spec[*|.] rendition[*|.]resource_name:value
다음 예제에서는 리소스 파일을 사용해 설정할 수 있는 XmRendition과 관련된 CTL 자원들을 보여줍니다. 레이아웃 객체가 효과를 발휘하려면 fontType을 FONT_IS_XOC로 설정해야 합니다. @ls를 사용해 지정된 layoutModifier는 rendition 객체에 의해 레이아웃 객체에 전달됩니다.
layoutModifier을 사용하여 레이아웃 객체에서 설정될 수 있는 자원의 완전한 목록은 CAE Specification: Portable Layout Services: Context-dependent and Directional Text, The Open Group: Feb 1997; ISBN 1-85912-142-X; 문서 번호 C616을 참조하십시오.
렌더 테이블을 만들기 전에 먼저 응용프로그램이 테이블의 일부인 rendition 중 최소 한 개를 작성해야 합니다. XmRenderTableAddRenditions() 함수는 이름이 암시하듯이 새 rendition으로 렌더 테이블을 증대시키는 데에도 사용됩니다. 새 렌더 테이블을 만들려면 기존 렌더 테이블 대신 NULL 인자로 XmRenderTableAddRenditions() 기능을 호출하십시오.
다음 코드는 XmFONT_IS_XOC에 설정된 XmNfontType으로 만든 rendition을 사용해 렌더 테이블을 만듭니다.
int n; Arg args[10]; Widget w; XmString labelString; XmRendition rendition; XmStringTag renditionTag; XmRenderTable renderTable; /* alef lam baa noon taa - iso8859-6 */ labelString = XmStringGenerate("\307\344\310\346\312\", NULL XmCHARSET_TEXT, "ArabicShaped"); w = XtVaCreateManagedWidget("a label", xmLabelWidgetClass, parent, XmNlabelString, labelString, XmNlabelType, XmSTRING, NULL); n = 0; XtSetArg(args[n], XmNfontName, "-*-*-medium-r-normal-*-24-*-*-*-*-*-*-*"); n++; XtSetArg(args[n], XmNfontType, XmFONT_IS_XOC); n++; XtSetArg(args[n], XmNlayoutAttrObject, "ar"); n++; XtSetArg(args[n], XmNlayoutModifier, "@ls numerals=nominal:contextual, shapecharset=iso8859-6"); n++; renditionTag = (XmStringTag) "ArabicShaped"; rendition = XmRenditionCreate(w, renditionTag, args, n); renderTable = XmRenderTableAddRenditions(NULL, &rendition, 1, XmREPLACE); XtVaSetValues(w, XmNrenderTable, renderTable, NULL);