Ticket #1685: app-server-unicode-font.diff
File app-server-unicode-font.diff, 2.3 KB (added by , 17 years ago) |
---|
-
src/servers/app/FontEngine.cpp
331 331 } 332 332 for (i = 0; i < bitmap.rows; i++) { 333 333 sl.reset_spans(); 334 const uint8* p = buf; 335 for (j = 0; j < bitmap.width; j++) { 336 if (*p) 337 sl.add_cell(x + j, *p); 338 ++p; 334 335 if (bitmap.pixel_mode == FT_PIXEL_MODE_MONO) { 336 // font has built-in mono bitmap 337 agg::bitset_iterator bits(buf, 0); 338 int j; 339 for (j = 0; j < bitmap.width; j++) { 340 if (bits.bit()) 341 sl.add_cell(x + j, agg::cover_full); 342 ++bits; 343 } 344 } else { 345 const uint8* p = buf; 346 for (j = 0; j < bitmap.width; j++) { 347 if (*p) 348 sl.add_cell(x + j, *p); 349 ++p; 350 } 339 351 } 352 340 353 buf += pitch; 341 354 if (sl.num_spans()) { 342 355 sl.finalize(y - i - 1); … … 579 592 break; 580 593 } 581 594 582 FT_Set_Pixel_Sizes(fFace, 583 unsigned(size * 64.0) >> 6, // pixel_width 584 unsigned(size * 64.0) >> 6); // pixel_height 595 bool fixed_size = false; 596 for(int i = 0; i < fFace->num_fixed_sizes; i++) { 597 if (fFace->available_sizes[i].height == (FT_Short)size) { 598 fixed_size = true; 599 break; 600 } 601 } 602 if (fixed_size) { 603 FT_Set_Pixel_Sizes(fFace, 0, (FT_UInt)size); 604 } else { 605 FT_Set_Char_Size(fFace, 0, (FT_F26Dot6)(size * 64.f), 0, 0); 606 } 585 607 586 if (charMap != FT_ENCODING_NONE) 608 if (charMap != FT_ENCODING_NONE) { 587 609 fLastError = FT_Select_Charmap(fFace, charMap); 610 } else { 611 if (FT_Select_Charmap(fFace, FT_ENCODING_UNICODE) != 0) 612 fLastError = FT_Select_Charmap(fFace, FT_ENCODING_NONE); 613 } 588 614 589 615 return fLastError == 0; 590 616 } -
src/servers/app/Desktop.cpp
371 371 if (fSharedReadOnlyArea < B_OK) 372 372 return fSharedReadOnlyArea; 373 373 374 gFontManager->AttachUser(fUserID); 375 374 376 fSettings = new DesktopSettingsPrivate(fServerReadOnlyMemory); 375 377 376 378 for (int32 i = 0; i < kMaxWorkspaces; i++) { … … 408 410 _RebuildClippingForAllWindows(stillAvailableOnScreen); 409 411 _SetBackground(stillAvailableOnScreen); 410 412 411 gFontManager->AttachUser(fUserID);412 413 413 SetCursor(NULL); 414 414 // this will set the default cursor 415 415