Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / MS / Internal / FontCache / CachedTypeface.cs / 1 / CachedTypeface.cs
//----------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Description: CachedTypeface
//
// History: 6-08-2005 garyyang, Created.
//
//---------------------------------------------------------------------------
using System;
using System.Windows;
using System.Windows.Media;
using MS.Internal.FontFace;
namespace MS.Internal.FontCache
{
///
/// CachedTypeface stores the canonical values and font data of a Typeface. It is looked up or constructed
/// when client does shaping or query metrics from Typeface objects. Caching this object allows
/// many equal typeface objects to share the same piece of canonicalized data.
///
internal class CachedTypeface
{
private FontStyle _canonicalStyle;
private FontWeight _canonicalWeight;
private FontStretch _canonicalStretch;
private IFontFamily _firstFontFamily;
private ITypefaceMetrics _typefaceMetrics;
private bool _nullFont;
internal CachedTypeface(
FontStyle canonicalStyle,
FontWeight canonicalWeight,
FontStretch canonicalStretch,
IFontFamily firstFontFamily,
ITypefaceMetrics typefaceMetrics,
bool nullFont
)
{
_canonicalStyle = canonicalStyle;
_canonicalWeight = canonicalWeight;
_canonicalStretch = canonicalStretch;
Invariant.Assert(firstFontFamily != null && typefaceMetrics != null);
_firstFontFamily = firstFontFamily;
_typefaceMetrics = typefaceMetrics;
_nullFont = nullFont;
}
internal FontStyle CanonicalStyle
{
get { return _canonicalStyle; }
}
internal FontWeight CanonicalWeight
{
get { return _canonicalWeight; }
}
internal FontStretch CanonicalStretch
{
get { return _canonicalStretch; }
}
internal IFontFamily FirstFontFamily
{
get { return _firstFontFamily; }
}
internal ITypefaceMetrics TypefaceMetrics
{
get { return _typefaceMetrics; }
}
internal bool NullFont
{
get { return _nullFont; }
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Description: CachedTypeface
//
// History: 6-08-2005 garyyang, Created.
//
//---------------------------------------------------------------------------
using System;
using System.Windows;
using System.Windows.Media;
using MS.Internal.FontFace;
namespace MS.Internal.FontCache
{
///
/// CachedTypeface stores the canonical values and font data of a Typeface. It is looked up or constructed
/// when client does shaping or query metrics from Typeface objects. Caching this object allows
/// many equal typeface objects to share the same piece of canonicalized data.
///
internal class CachedTypeface
{
private FontStyle _canonicalStyle;
private FontWeight _canonicalWeight;
private FontStretch _canonicalStretch;
private IFontFamily _firstFontFamily;
private ITypefaceMetrics _typefaceMetrics;
private bool _nullFont;
internal CachedTypeface(
FontStyle canonicalStyle,
FontWeight canonicalWeight,
FontStretch canonicalStretch,
IFontFamily firstFontFamily,
ITypefaceMetrics typefaceMetrics,
bool nullFont
)
{
_canonicalStyle = canonicalStyle;
_canonicalWeight = canonicalWeight;
_canonicalStretch = canonicalStretch;
Invariant.Assert(firstFontFamily != null && typefaceMetrics != null);
_firstFontFamily = firstFontFamily;
_typefaceMetrics = typefaceMetrics;
_nullFont = nullFont;
}
internal FontStyle CanonicalStyle
{
get { return _canonicalStyle; }
}
internal FontWeight CanonicalWeight
{
get { return _canonicalWeight; }
}
internal FontStretch CanonicalStretch
{
get { return _canonicalStretch; }
}
internal IFontFamily FirstFontFamily
{
get { return _firstFontFamily; }
}
internal ITypefaceMetrics TypefaceMetrics
{
get { return _typefaceMetrics; }
}
internal bool NullFont
{
get { return _nullFont; }
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SplitterPanel.cs
- SetIterators.cs
- XmlSchemaDocumentation.cs
- Thread.cs
- WriterOutput.cs
- DocumentSchemaValidator.cs
- LogReserveAndAppendState.cs
- XPathDocumentIterator.cs
- ReferencedAssembly.cs
- BitmapCache.cs
- DelegatingConfigHost.cs
- MsmqHostedTransportConfiguration.cs
- ConfigurationManagerHelper.cs
- SequenceNumber.cs
- ButtonColumn.cs
- SqlNotificationRequest.cs
- SerializationSectionGroup.cs
- Permission.cs
- CloseCollectionAsyncResult.cs
- JsonByteArrayDataContract.cs
- HierarchicalDataSourceControl.cs
- MediaTimeline.cs
- BitmapEffect.cs
- InternalConfirm.cs
- DuplexChannel.cs
- CustomTypeDescriptor.cs
- OdbcDataReader.cs
- MetadataArtifactLoaderFile.cs
- Brushes.cs
- webeventbuffer.cs
- ApplicationServiceManager.cs
- StrongNameKeyPair.cs
- dataobject.cs
- TransformDescriptor.cs
- ContentPathSegment.cs
- WindowsGraphics.cs
- FontStretch.cs
- XmlSchemaAppInfo.cs
- ArrayTypeMismatchException.cs
- SiteMapNode.cs
- DoubleKeyFrameCollection.cs
- DeclarativeExpressionConditionDeclaration.cs
- SystemKeyConverter.cs
- InvokeMethodActivity.cs
- MyContact.cs
- ClaimSet.cs
- MergeEnumerator.cs
- streamingZipPartStream.cs
- MenuItemCollection.cs
- CodeAttachEventStatement.cs
- XslAst.cs
- SafeProcessHandle.cs
- CodeCompiler.cs
- StandardToolWindows.cs
- DataGridViewCheckBoxColumn.cs
- Context.cs
- ReferentialConstraint.cs
- PriorityQueue.cs
- WorkflowDefinitionDispenser.cs
- PersonalizationStateInfoCollection.cs
- ServiceCredentialsElement.cs
- WebRequestModuleElementCollection.cs
- CursorInteropHelper.cs
- VersionedStreamOwner.cs
- SqlMetaData.cs
- WebPartConnectionsConnectVerb.cs
- MatrixStack.cs
- NestedContainer.cs
- MarshalByValueComponent.cs
- ChtmlPageAdapter.cs
- Header.cs
- DataGridViewColumnConverter.cs
- SimpleMailWebEventProvider.cs
- TransactedBatchingBehavior.cs
- TemplateFactory.cs
- FtpWebResponse.cs
- ValidationSummary.cs
- EncoderExceptionFallback.cs
- DynamicControlParameter.cs
- SmtpReplyReader.cs
- MetadataWorkspace.cs
- ColumnHeader.cs
- Utils.cs
- WebPartDisplayModeCollection.cs
- TextBoxAutoCompleteSourceConverter.cs
- IntAverageAggregationOperator.cs
- Size3D.cs
- StorageTypeMapping.cs
- UIElementParaClient.cs
- SafeLibraryHandle.cs
- DesignerPainter.cs
- KnownBoxes.cs
- listitem.cs
- DefaultAuthorizationContext.cs
- DrawToolTipEventArgs.cs
- ExceptionRoutedEventArgs.cs
- IntegerFacetDescriptionElement.cs
- TextTreeTextNode.cs
- SvcMapFileLoader.cs
- CompositeCollection.cs